ACS: Try to fix sprnames garbage

This commit is contained in:
Sally Coolatta 2023-04-29 13:07:00 -04:00
parent d953049c78
commit 4f2c47fde0

View file

@ -159,7 +159,7 @@ static bool ACS_GetSpriteFromString(const char *word, spritenum_t *type)
for (int i = 0; i < NUMSPRITES; i++)
{
if (fastcmp(word, sprnames[i]))
if (fastncmp(word, sprnames[i], 4))
{
*type = static_cast<spritenum_t>(i);
return true;
@ -2529,7 +2529,9 @@ bool CallFunc_GetThingProperty(ACSVM::Thread *thread, const ACSVM::Word *argV, A
#define PROP_SPR(x, y) \
case x: \
{ \
value = static_cast<INT32>( ~env->getString( sprnames[ mobj->y ] )->idx ); \
char crunched[5] = {0}; \
strncpy(crunched, sprnames[ mobj->y ], 4); \
value = static_cast<INT32>( ~env->getString( crunched )->idx ); \
break; \
}