1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-25 13:17:46 +00:00

Fix crash if shpk_name is null

This is common for the new Dawntrail models where I think this is
failing on, and should at least prevent an easy crash.
This commit is contained in:
Joshua Goins 2024-10-20 19:43:00 -04:00
parent e76a14fa6a
commit 756a37ecac

View file

@ -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;