mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 08:47:17 +01:00
Adjust range checks when converting vehicle name to identifier.
This commit is contained in:
parent
7b3b7cb6c2
commit
7735070ef8
@ -64,16 +64,16 @@ Int32 GetAutomobileID(CSStr name)
|
||||
return SQMOD_UNKNOWN;
|
||||
}
|
||||
// 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 vehicle
|
||||
CharT a = str[0], b = 0, c = 0, d = str[len-1];
|
||||
// Look for deeper specifiers
|
||||
if(len >= 3)
|
||||
if(len > 2)
|
||||
{
|
||||
c = str[2];
|
||||
b = str[1];
|
||||
}
|
||||
else if(len >= 2)
|
||||
else if(len > 1)
|
||||
{
|
||||
b = str[1];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user