- fixed check for wallsprites on walls.

This completely ignored the case where a wall was flagged as one-sided which was the main reason with that sneaky sign in E2L1.
The problem is not entirely fixed with this but now it will detect that it's on a wall.
This commit is contained in:
Christoph Oelckers 2021-12-29 16:56:04 +01:00
parent 4f8f85c634
commit 1a2b9d43f7

View file

@ -118,7 +118,7 @@ static int IsOnWall(tspritetype* tspr, int height)
int topz = (tspr->pos.Z - ((height * tspr->yrepeat) << 2)); int topz = (tspr->pos.Z - ((height * tspr->yrepeat) << 2));
for(auto& wal : wallsofsector(sect)) for(auto& wal : wallsofsector(sect))
{ {
if ((wal.nextsector == -1 || ((wal.nextSector()->ceilingz > topz) || if ((wal.nextsector == -1 || (wal.cstat & CSTAT_WALL_1WAY) || ((wal.nextSector()->ceilingz > topz) ||
wal.nextSector()->floorz < tspr->pos.Z)) && !GetClosestPointOnWall(tspr, &wal, &n)) wal.nextSector()->floorz < tspr->pos.Z)) && !GetClosestPointOnWall(tspr, &wal, &n))
{ {
int const dst = abs(tspr->pos.X - n.X) + abs(tspr->pos.Y - n.Y); int const dst = abs(tspr->pos.X - n.X) + abs(tspr->pos.Y - n.Y);