mirror of
https://github.com/GTAmodding/re3.git
synced 2024-11-25 12:13:44 +00:00
Fix UB in ProjectileInfo.cpp
This commit is contained in:
parent
1a8a1c91cb
commit
9938d04ca7
1 changed files with 5 additions and 1 deletions
|
@ -128,8 +128,12 @@ CProjectileInfo::AddProjectile(CEntity *entity, eWeaponType weapon, CVector pos,
|
|||
}
|
||||
|
||||
int i = 0;
|
||||
#ifdef FIX_BUGS
|
||||
while (i < ARRAY_SIZE(gaProjectileInfo) && gaProjectileInfo[i].m_bInUse) i++;
|
||||
#else
|
||||
// array overrun is UB
|
||||
while (gaProjectileInfo[i].m_bInUse && i < ARRAY_SIZE(gaProjectileInfo)) i++;
|
||||
|
||||
#endif
|
||||
if (i == ARRAY_SIZE(gaProjectileInfo))
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue