Fix a divide by zero crash when mindash and maxdash were the same.

Props to rumia1 for finding this and Lach for figuring out this was a divide by zero error.
This commit is contained in:
GoldenTails 2019-12-15 04:09:56 -06:00
parent 7f092b884b
commit 23b3f5a649

View file

@ -4635,7 +4635,7 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd)
S_StartSound(player->mo, sfx_spin);
break;
}
if (player->dashspeed < player->maxdash)
if (player->dashspeed < player->maxdash && player->mindash != player->maxdash)
{
#define chargecalculation (6*(player->dashspeed - player->mindash))/(player->maxdash - player->mindash)
fixed_t soundcalculation = chargecalculation;