diff --git a/src/r_things.c b/src/r_things.c index 90d5f3fd3af51269e77f204affaff51d23d6d9f1..0def36d8a2a23b139c06cb3b9ffc5de09a6e420b 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1340,9 +1340,10 @@ static void R_ProjectSprite(mobj_t *thing) if ((range = x2 - x1) <= 0) return; + range++; // fencepost problem + scalestep = (yscale2 - yscale)/range; - scalestep = scalestep ? scalestep : 1; - xscale = FixedDiv(range<<FRACBITS, abs(offset2))+1; + xscale = FixedDiv(range<<FRACBITS, abs(offset2)); // The following two are alternate sorting methods which might be more applicable in some circumstances. TODO - maybe enable via MF2? // sortscale = max(yscale, yscale2);