mirror of
https://github.com/ZDoom/Raze.git
synced 2025-06-02 02:01:31 +00:00
- consolidated Duke’s ‚away from wall‘ check in the backend
This was also very useful in SW to avoid spawning ‚floating‘ footprints due to lack of an equivalent check in the original.
This commit is contained in:
parent
1a597c4e0b
commit
3c9a94dba8
5 changed files with 42 additions and 58 deletions
|
@ -560,6 +560,35 @@ sectortype* nextsectorneighborzptr(sectortype* sectp, double startz, int flags)
|
|||
return bestsec;
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
bool isAwayFromWall(DCoreActor* ac, double delta)
|
||||
{
|
||||
sectortype* s1;
|
||||
|
||||
updatesector(ac->spr.pos + DVector2(delta, delta), &s1);
|
||||
if (s1 == ac->sector())
|
||||
{
|
||||
updatesector(ac->spr.pos - DVector2(delta, delta), &s1);
|
||||
if (s1 == ac->sector())
|
||||
{
|
||||
updatesector(ac->spr.pos + DVector2(delta, -delta), &s1);
|
||||
if (s1 == ac->sector())
|
||||
{
|
||||
updatesector(ac->spr.pos + DVector2(-delta, delta), &s1);
|
||||
if (s1 == ac->sector())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue