mirror of
https://github.com/halpz/re3.git
synced 2025-07-01 13:46:17 +00:00
Fix use of strncmp
This commit is contained in:
@ -2169,10 +2169,10 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
|
||||
case COMMAND_PRINT_HELP:
|
||||
{
|
||||
if (CCamera::m_bUseMouse3rdPerson && (
|
||||
strncmp((char*)&CTheScripts::ScriptSpace[m_nIp], "HELP15", 7) == 0 ||
|
||||
strncmp((char*)&CTheScripts::ScriptSpace[m_nIp], "GUN_2A", 7) == 0 ||
|
||||
strncmp((char*)&CTheScripts::ScriptSpace[m_nIp], "GUN_2C", 7) == 0 ||
|
||||
strncmp((char*)&CTheScripts::ScriptSpace[m_nIp], "GUN_2D", 7) == 0)) {
|
||||
strcmp((char*)&CTheScripts::ScriptSpace[m_nIp], "HELP15") == 0 ||
|
||||
strcmp((char*)&CTheScripts::ScriptSpace[m_nIp], "GUN_2A") == 0 ||
|
||||
strcmp((char*)&CTheScripts::ScriptSpace[m_nIp], "GUN_2C") == 0 ||
|
||||
strcmp((char*)&CTheScripts::ScriptSpace[m_nIp], "GUN_2D") == 0)) {
|
||||
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
||||
return 0;
|
||||
}
|
||||
|
@ -132,11 +132,12 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
|
||||
CollectParameters(&m_nIp, 1);
|
||||
CPlayerInfo* pPlayerInfo = &CWorld::Players[ScriptParams[0]];
|
||||
char key[KEY_LENGTH_IN_SCRIPT];
|
||||
memset(key, 0, KEY_LENGTH_IN_SCRIPT);
|
||||
CTheScripts::ReadTextLabelFromScript(&m_nIp, key);
|
||||
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
||||
CVector pos = pPlayerInfo->GetPos();
|
||||
CZone *infoZone = CTheZones::FindInformationZoneForPosition(&pos);
|
||||
UpdateCompareFlag(strncmp(key, infoZone->name, 8) == 0);
|
||||
UpdateCompareFlag(strncmp(key, infoZone->name, 8) == 0); // original code doesn't seem to be using strncmp in here and compare 2 ints instead
|
||||
return 0;
|
||||
}
|
||||
case COMMAND_CLEAR_CHAR_ICE_CREAM_PURCHASE:
|
||||
|
Reference in New Issue
Block a user