diff --git a/source/core/rendering/scene/hw_walls.cpp b/source/core/rendering/scene/hw_walls.cpp index c16d5ef73..2dc9a2bc3 100644 --- a/source/core/rendering/scene/hw_walls.cpp +++ b/source/core/rendering/scene/hw_walls.cpp @@ -61,7 +61,7 @@ static walltype* IsOnWall(tspritetype* tspr, int height, DVector2& outpos) // Intentionally include two sided walls. Even on them the sprite should be projected onto the wall for better results. auto d = wal.delta(); int walang = getangle(d.X, d.Y); - int deltaang = abs(walang - tspr->ang) & 2047; + int deltaang = abs((((walang - tspr->ang) & 2047) << 21) >> 21); const int maxangdelta = 1; // angle of the sprite must either be the wall's normal or the negative wall's normal to be aligned.