From: Holger Schemel Date: Fri, 6 Mar 2015 00:47:55 +0000 (+0100) Subject: fixed bug which could cause division by zero X-Git-Tag: 4.0.0.0-rc1~246 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=2d33cabb4017e5e4c2c4678db762b41d5ca9ea85 fixed bug which could cause division by zero --- diff --git a/src/tools.c b/src/tools.c index 3af2b5f9..247bcffd 100644 --- a/src/tools.c +++ b/src/tools.c @@ -4184,6 +4184,8 @@ unsigned int MoveDoor(unsigned int door_state) } } + max_step_delay = MAX(1, max_step_delay); // prevent division by zero + num_move_steps = max_move_delay / max_step_delay; num_move_steps_doors_only = max_move_delay_doors_only / max_step_delay;