prevent zero division if 0 as wait is passed to <FON/<FOM

This commit is contained in:
Alula 2022-02-25 06:06:30 +01:00
parent 19dad43d7a
commit 39171cc9a9
1 changed files with 4 additions and 0 deletions

View File

@ -95,6 +95,10 @@ impl Frame {
screen_width += 10.0;
}
if self.wait == 0 { // prevent zero division
self.wait = 1;
}
let tile_size = state.tile_size.as_int();
if (stage.map.width as usize).saturating_sub(1) * (tile_size as usize) < screen_width as usize {