From 438de82c69185469ca86bf70c1ad3f291ceb198b Mon Sep 17 00:00:00 2001 From: Lactozilla Date: Fri, 27 Sep 2024 19:47:54 -0300 Subject: [PATCH] Fix TRNSLATE lumps being recognized as valid sprite names --- src/r_things.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/r_things.c b/src/r_things.c index 432b5e10b..50855e2fc 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -279,6 +279,14 @@ static boolean GetFramesAndRotationsFromShortLumpName( *ret_rotation2 = R_Char2Rotation(name[7]); if (*ret_frame2 >= 64 || *ret_rotation2 == 255) return false; + + // TRNSLATE is a valid but extremely unlikely sprite name: + // * The sprite name is "TRNS" + // * The frame is L, rotation A; mirrored to frame T, rotation E + // In the very unfortunate event that TRNSLATE is found between sprite lumps, + // this name check prevents it from being added as a sprite, when it actually isn't. + if (memcmp(name, "TRNSLATE", 8) == 0) + return false; } else {