summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-12-31 16:14:51 +0100
committeraap <aap@papnet.eu>2020-12-31 16:14:51 +0100
commitd89d3db1261d3effdb774e2901a508cd45b9a197 (patch)
tree72c9afb6d2906e61d00f6b25242356dad4d9c687 /src
parentfix use of LoadFile (diff)
downloadre3-d89d3db1261d3effdb774e2901a508cd45b9a197.tar
re3-d89d3db1261d3effdb774e2901a508cd45b9a197.tar.gz
re3-d89d3db1261d3effdb774e2901a508cd45b9a197.tar.bz2
re3-d89d3db1261d3effdb774e2901a508cd45b9a197.tar.lz
re3-d89d3db1261d3effdb774e2901a508cd45b9a197.tar.xz
re3-d89d3db1261d3effdb774e2901a508cd45b9a197.tar.zst
re3-d89d3db1261d3effdb774e2901a508cd45b9a197.zip
Diffstat (limited to 'src')
-rw-r--r--src/weapons/Explosion.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/weapons/Explosion.cpp b/src/weapons/Explosion.cpp
index 38ce6e53..74137dc0 100644
--- a/src/weapons/Explosion.cpp
+++ b/src/weapons/Explosion.cpp
@@ -121,7 +121,12 @@ CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionT
#endif
int n = 0;
+#ifdef FIX_BUGS
+ while (n < ARRAY_SIZE(gaExplosion) && gaExplosion[n].m_nIteration != 0)
+#else
+ // array overrun is UB
while (gaExplosion[n].m_nIteration != 0 && n < ARRAY_SIZE(gaExplosion))
+#endif
n++;
if (n == ARRAY_SIZE(gaExplosion))
return false;