use texturenum -1 for chr hits because cheap version of chrTestHit returns an uninitialized value

This commit is contained in:
joshuarwood committed 2026-03-12 18:31:17 -05:00
1 parent 246d737663
commit 23aafa4ffa
1 file changed
+1 -1
+1 -1
View File
@@ -1071,7 +1071,7 @@ bool shotTestLos(struct coord *gunpos2d, struct coord *gundir2d, struct coord *g
objTestHit(prop, &shotdata);
}
if (shotdata.hits[0].prop) {
texturenum = shotdata.hits[0].hitthing.texturenum;
texturenum = (prop->type == PROPTYPE_CHR || prop->type == PROPTYPE_PLAYER) ? -1 : shotdata.hits[0].hitthing.texturenum;
surfacetype = (texturenum >= 0 && texturenum < NUM_TEXTURES) ? g_Textures[texturenum].surfacetype : SURFACETYPE_DEFAULT;
// ignore some glass parts and shields
if (shotdata.hits[0].slowsbullet && texturenum != 10000 &&