From 0fc5f0d768d8364238bb6307031c08491efdbe85 Mon Sep 17 00:00:00 2001 From: Prince Frizzy Date: Sat, 26 Feb 2022 05:46:08 -0500 Subject: [PATCH] Proper NULL check for this in water_ring.c The water ring index should NOT increment if a water ring fails to spawn. --- src/game/behaviors/water_ring.inc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/game/behaviors/water_ring.inc.c b/src/game/behaviors/water_ring.inc.c index f36bdf70..d0db20f2 100644 --- a/src/game/behaviors/water_ring.inc.c +++ b/src/game/behaviors/water_ring.inc.c @@ -170,10 +170,11 @@ void water_ring_spawner_act_inactive(void) { waterRing = spawn_object(o, MODEL_WATER_RING, bhvJetStreamWaterRing); if (waterRing != NULL) { waterRing->oWaterRingIndex = currentObj->oWaterRingMgrNextRingIndex; + currentObj->oWaterRingMgrNextRingIndex++; + if (currentObj->oWaterRingMgrNextRingIndex >= 10001) { + currentObj->oWaterRingMgrNextRingIndex = 0; + } } - currentObj->oWaterRingMgrNextRingIndex++; - if (currentObj->oWaterRingMgrNextRingIndex >= 10001) - currentObj->oWaterRingMgrNextRingIndex = 0; } }