diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 50ada4e3d9..e53b305821 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,5 @@ July 16, 2009 +- Reduced potential for overflow in R_ProjectSprite(). - Moved the IF_ADDITIVETIME check earlier in APowerup::HandlePickup so that additive time powerups can be activated before the existing power has entered its blink threshold. diff --git a/src/r_things.cpp b/src/r_things.cpp index 6a29c87903..1acea38789 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -1381,7 +1381,7 @@ void R_ProjectSprite (AActor *thing, int fakeside) vis->RenderStyle = thing->RenderStyle; vis->FillColor = thing->fillcolor; vis->xscale = xscale; - vis->yscale = Scale (InvZtoScale, yscale, tz)>>4; + vis->yscale = Scale (InvZtoScale, yscale, tz << 4); vis->depth = tz; vis->idepth = (DWORD)DivScale32 (1, tz) >> 1; // tz is 20.12, so idepth ought to be 12.20, but vis->cx = tx2; // signed math makes it 13.19