Fix proximity bomb failure-to-spin
Commit7d36df315e
restructured draw_weapon_vclip, but unintentionally broke the spin of proximity bombs because `modtime` could exceed `play_time * 2`, causing `draw_vclip_object` to clamp `bitmapnum` to the last frame of the animation. Switch from `-=` to `%=` so that modtime is always brought back in range. Reported-by: Descender1032 <https://forum.dxx-rebirth.com/showthread.php?tid=1005> Fixes:7d36df315e
("Simplify draw_weapon_vclip")
This commit is contained in:
parent
bcb3f6b486
commit
1f333868eb
|
@ -80,7 +80,7 @@ void draw_weapon_vclip(grs_canvas &canvas, const vcobjptridx_t obj)
|
|||
modtime += (lifeleft * (objnum & 7)) / 16; //add variance to spin rate
|
||||
|
||||
if (modtime > play_time)
|
||||
modtime -= play_time;
|
||||
modtime %= play_time;
|
||||
|
||||
if ((objnum&1) ^ ((objnum>>1)&1)) //make some spin other way
|
||||
modtime = play_time - modtime;
|
||||
|
|
Loading…
Reference in a new issue