Skip to content

Commit

Permalink
Fix crash if shpk_name is null
Browse files Browse the repository at this point in the history
This is common for the new Dawntrail models where I think this is
failing on, and should at least prevent an easy crash.
  • Loading branch information
redstrate committed Oct 20, 2024
1 parent e76a14f commit 756a37e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parts/mdl/mdlpart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ RenderMaterial MDLPart::createOrCacheMaterial(const physis_Material &mat)
uint64_t MDLPart::getMaterialHash(const physis_Material &mat)
{
// TODO: this hash is terrible
uint64_t hash = strlen(mat.shpk_name);
uint64_t hash = mat.shpk_name ? strlen(mat.shpk_name) : 0;
hash += mat.num_constants;
hash += mat.num_samplers;
hash += mat.num_shader_keys;
Expand Down

0 comments on commit 756a37e

Please sign in to comment.