mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-02-21 20:27:13 +01:00
Adjust range checks when converting weapon name to identifier.
This commit is contained in:
parent
7cb413111e
commit
7b3b7cb6c2
@ -60,16 +60,16 @@ Int32 GetWeaponID(CCStr name)
|
|||||||
return SQMOD_UNKNOWN;
|
return SQMOD_UNKNOWN;
|
||||||
}
|
}
|
||||||
// Grab the actual length of the string
|
// Grab the actual length of the string
|
||||||
Uint32 len = static_cast< Uint32 >(str.length());
|
const Uint32 len = static_cast< Uint32 >(str.length());
|
||||||
// Get the most significant characters used to identify a weapon
|
// Get the most significant characters used to identify a weapon
|
||||||
CharT a = str[0], b = 0, c = 0, d = str[len-1];
|
CharT a = str[0], b = 0, c = 0, d = str[len-1];
|
||||||
// Look for deeper specifiers
|
// Look for deeper specifiers
|
||||||
if(len >= 3)
|
if(len > 2)
|
||||||
{
|
{
|
||||||
c = str[2];
|
c = str[2];
|
||||||
b = str[1];
|
b = str[1];
|
||||||
}
|
}
|
||||||
else if(len >= 2)
|
else if(len > 1)
|
||||||
{
|
{
|
||||||
b = str[1];
|
b = str[1];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user