Fix proximity bomb failure-to-spin

Commit 7d36df315e 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:
Kp 2017-12-02 04:31:26 +00:00
parent bcb3f6b486
commit 1f333868eb

View file

@ -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;