Guard against division by zero crash

Closes #197.
This commit is contained in:
Curtis Rueden
2024-04-03 12:26:27 -05:00
committed by teejusb
parent 3138447138
commit ce3cb266a1
+1
View File
@@ -275,6 +275,7 @@ void DancingCharacters::Update( float fDelta )
int iCurBeat = (int)GAMESTATE->m_Position.m_fSongBeat; int iCurBeat = (int)GAMESTATE->m_Position.m_fSongBeat;
// Need to convert it to a int, otherwise it complains. // Need to convert it to a int, otherwise it complains.
int NewBeatToSet = (int)AMM_BEATS_TIL_NEXTCAMERA; int NewBeatToSet = (int)AMM_BEATS_TIL_NEXTCAMERA;
if (NewBeatToSet != 0)
iCurBeat -= iCurBeat % NewBeatToSet; iCurBeat -= iCurBeat % NewBeatToSet;
m_fThisCameraStartBeat = (float)iCurBeat; m_fThisCameraStartBeat = (float)iCurBeat;