Proper NULL check for this in water_ring.c

The water ring index should NOT increment if a water ring fails to spawn.
This commit is contained in:
Prince Frizzy 2022-02-26 05:46:08 -05:00 committed by djoslin0
parent d3b4e1c794
commit 0fc5f0d768

View file

@ -170,10 +170,11 @@ void water_ring_spawner_act_inactive(void) {
waterRing = spawn_object(o, MODEL_WATER_RING, bhvJetStreamWaterRing); waterRing = spawn_object(o, MODEL_WATER_RING, bhvJetStreamWaterRing);
if (waterRing != NULL) { if (waterRing != NULL) {
waterRing->oWaterRingIndex = currentObj->oWaterRingMgrNextRingIndex; waterRing->oWaterRingIndex = currentObj->oWaterRingMgrNextRingIndex;
currentObj->oWaterRingMgrNextRingIndex++;
if (currentObj->oWaterRingMgrNextRingIndex >= 10001) {
currentObj->oWaterRingMgrNextRingIndex = 0;
}
} }
currentObj->oWaterRingMgrNextRingIndex++;
if (currentObj->oWaterRingMgrNextRingIndex >= 10001)
currentObj->oWaterRingMgrNextRingIndex = 0;
} }
} }