diff --git a/src/newgrf_animation_base.h b/src/newgrf_animation_base.h index c41b0639e1..063e23e7b9 100644 --- a/src/newgrf_animation_base.h +++ b/src/newgrf_animation_base.h @@ -69,7 +69,7 @@ struct AnimationBase { * increasing this value by one doubles the wait. 0 is the minimum value * allowed for animation_speed, which corresponds to 30ms, and 16 is the * maximum, corresponding to around 33 minutes. */ - if (_scaled_tick_counter % (1 << animation_speed) != 0) return; + if ((((uint32)_scaled_tick_counter) & ((1 << animation_speed) - 1)) != 0) return; uint8 frame = Tframehelper::Get(obj, tile); uint8 num_frames = spec->animation.frames;