mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- fixed issue with wall sprite angle check.
The resulting value had no sign, so 'abs' did not work. It now uses some bit shifting magic to get a proper sign.
This commit is contained in:
parent
61d4d06783
commit
f679b61a30
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue