Skip to content

Commit f82455d

Browse files
authored
Move hamdata.ini to gamedata (#597)
* Replace atoi by strtol in the config parser * Move hamdata.ini data to gamedata files * Reference the new files in master file * Remove all the parsing code and use config manager to get the offsets * Remove any hamdata.ini references
1 parent 8717ffe commit f82455d

File tree

21 files changed

+11851
-5085
lines changed

21 files changed

+11851
-5085
lines changed

amxmodx/CGameConfigs.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,16 +325,16 @@ SMCResult CGameConfig::ReadSMC_KeyValue(const SMCStates *states, const char *key
325325
}
326326
else if (!strcmp(key, "size"))
327327
{
328-
TempType.fieldSize = ke::Max<int>(0, atoi(value));
328+
TempType.fieldSize = ke::Max<int>(0, strtol(value, nullptr, 0));
329329
}
330330
else if (!strcmp(key, "unsigned"))
331331
{
332-
TempType.fieldUnsigned = !!atoi(value);
332+
TempType.fieldUnsigned = !!strtol(value, nullptr, 0);
333333
}
334334
else if (g_LibSys.IsPlatformCompatible(key, &m_MatchedPlatform))
335335
{
336336
m_FoundOffset = true;
337-
TempType.fieldOffset = atoi(value);
337+
TempType.fieldOffset = strtol(value, nullptr, 0);
338338
}
339339
break;
340340
}
@@ -397,7 +397,7 @@ SMCResult CGameConfig::ReadSMC_KeyValue(const SMCStates *states, const char *key
397397

398398
if (m_AddressReadCount < limit)
399399
{
400-
m_AddressRead[m_AddressReadCount] = atoi(value);
400+
m_AddressRead[m_AddressReadCount] = strtol(value, nullptr, 0);
401401
m_AddressReadCount++;
402402
}
403403
else

0 commit comments

Comments
 (0)