Fix match

This commit is contained in:
Christian Semmler 2023-10-09 08:55:37 -04:00
parent a7a44fda93
commit 4ca192462d

View File

@ -83,19 +83,17 @@ void MxDSSelectAction::Deserialize(char **p_source, MxS16 p_unk24)
this->m_unk0x9c = *p_source; this->m_unk0x9c = *p_source;
const char *result;
char buffer[6];
if (!strnicmp(this->m_unk0x9c.GetData(), "RANDOM_", strlen("RANDOM_"))) { if (!strnicmp(this->m_unk0x9c.GetData(), "RANDOM_", strlen("RANDOM_"))) {
char buffer[10];
MxS16 value = atoi(&this->m_unk0x9c.GetData()[strlen("RANDOM_")]); MxS16 value = atoi(&this->m_unk0x9c.GetData()[strlen("RANDOM_")]);
srand(Timer()->GetTime()); srand(Timer()->GetTime());
MxS32 random = rand() % value; MxS32 random = rand() % value;
result = itoa((MxS16) random, buffer, 10); string = itoa((MxS16) random, buffer, 10);
} }
else else
result = VariableTable()->GetVariable(*p_source); string = VariableTable()->GetVariable(*p_source);
string = result;
*p_source += strlen(*p_source) + 1; *p_source += strlen(*p_source) + 1;
MxU32 count = *(MxU32*) *p_source; MxU32 count = *(MxU32*) *p_source;