mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +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;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
|
@ -350,7 +350,7 @@ enum EFindNextSector
|
||||||
Find_FloorDown = Find_Floor | Find_Down,
|
Find_FloorDown = Find_Floor | Find_Down,
|
||||||
};
|
};
|
||||||
sectortype* nextsectorneighborzptr(sectortype* sectp, double startz, int flags);
|
sectortype* nextsectorneighborzptr(sectortype* sectp, double startz, int flags);
|
||||||
|
bool isAwayFromWall(DCoreActor* ac, double delta);
|
||||||
|
|
||||||
|
|
||||||
inline double WallStartX(int wallnum)
|
inline double WallStartX(int wallnum)
|
||||||
|
|
|
@ -2801,23 +2801,7 @@ int ParseState::parse(void)
|
||||||
{
|
{
|
||||||
auto s1 = g_ac->sector();
|
auto s1 = g_ac->sector();
|
||||||
|
|
||||||
j = 0;
|
j = isAwayFromWall(g_ac, 6.75);
|
||||||
|
|
||||||
updatesector(g_ac->int_pos().X + 108, g_ac->int_pos().Y + 108, &s1);
|
|
||||||
if (s1 == g_ac->sector())
|
|
||||||
{
|
|
||||||
updatesector(g_ac->int_pos().X - 108, g_ac->int_pos().Y - 108, &s1);
|
|
||||||
if (s1 == g_ac->sector())
|
|
||||||
{
|
|
||||||
updatesector(g_ac->int_pos().X + 108, g_ac->int_pos().Y - 108, &s1);
|
|
||||||
if (s1 == g_ac->sector())
|
|
||||||
{
|
|
||||||
updatesector(g_ac->int_pos().X - 108, g_ac->int_pos().Y + 108, &s1);
|
|
||||||
if (s1 == g_ac->sector())
|
|
||||||
j = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
parseifelse(j);
|
parseifelse(j);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -340,28 +340,12 @@ void spawntransporter(DDukeActor *actj, DDukeActor* act, bool beam)
|
||||||
|
|
||||||
int spawnbloodpoolpart1(DDukeActor* act)
|
int spawnbloodpoolpart1(DDukeActor* act)
|
||||||
{
|
{
|
||||||
auto s1 = act->sector();
|
bool away = isAwayFromWall(act, 6.75);
|
||||||
|
|
||||||
updatesector(act->int_pos().X + 108, act->int_pos().Y + 108, &s1);
|
if (!away)
|
||||||
if (s1 && s1->floorz == act->sector()->floorz)
|
|
||||||
{
|
{
|
||||||
updatesector(act->int_pos().X - 108, act->int_pos().Y - 108, &s1);
|
act->spr.xrepeat = act->spr.yrepeat = 0; ChangeActorStat(act, STAT_MISC); return true;
|
||||||
if (s1 && s1->floorz == act->sector()->floorz)
|
|
||||||
{
|
|
||||||
updatesector(act->int_pos().X + 108, act->int_pos().Y - 108, &s1);
|
|
||||||
if (s1 && s1->floorz == act->sector()->floorz)
|
|
||||||
{
|
|
||||||
updatesector(act->int_pos().X - 108, act->int_pos().Y + 108, &s1);
|
|
||||||
if (s1 && s1->floorz != act->sector()->floorz)
|
|
||||||
{
|
|
||||||
act->spr.xrepeat = act->spr.yrepeat = 0; ChangeActorStat(act, STAT_MISC); return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else { act->spr.xrepeat = act->spr.yrepeat = 0; ChangeActorStat(act, STAT_MISC); return true; }
|
|
||||||
}
|
|
||||||
else { act->spr.xrepeat = act->spr.yrepeat = 0; ChangeActorStat(act, STAT_MISC); return true; }
|
|
||||||
}
|
}
|
||||||
else { act->spr.xrepeat = act->spr.yrepeat = 0; ChangeActorStat(act, STAT_MISC); return true; }
|
|
||||||
|
|
||||||
if (act->sector()->lotag == 1)
|
if (act->sector()->lotag == 1)
|
||||||
{
|
{
|
||||||
|
@ -382,28 +366,12 @@ void initfootprint(DDukeActor* actj, DDukeActor* act)
|
||||||
auto sect = act->sector();
|
auto sect = act->sector();
|
||||||
if (actj)
|
if (actj)
|
||||||
{
|
{
|
||||||
auto s1 = act->sector();
|
bool away = isAwayFromWall(act, 5.25);
|
||||||
|
if (!away)
|
||||||
updatesector(act->int_pos().X + 84, act->int_pos().Y + 84, &s1);
|
|
||||||
if (s1 && s1->floorz == act->sector()->floorz)
|
|
||||||
{
|
{
|
||||||
updatesector(act->int_pos().X - 84, act->int_pos().Y - 84, &s1);
|
act->spr.xrepeat = act->spr.yrepeat = 0;
|
||||||
if (s1 && s1->floorz == act->sector()->floorz)
|
return;
|
||||||
{
|
|
||||||
updatesector(act->int_pos().X + 84, act->int_pos().Y - 84, &s1);
|
|
||||||
if (s1 && s1->floorz == act->sector()->floorz)
|
|
||||||
{
|
|
||||||
updatesector(act->int_pos().X - 84, act->int_pos().Y + 84, &s1);
|
|
||||||
if (s1 && s1->floorz != act->sector()->floorz)
|
|
||||||
{
|
|
||||||
act->spr.xrepeat = act->spr.yrepeat = 0; ChangeActorStat(act, STAT_MISC); return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else { act->spr.xrepeat = act->spr.yrepeat = 0; return; }
|
|
||||||
}
|
|
||||||
else { act->spr.xrepeat = act->spr.yrepeat = 0; return; }
|
|
||||||
}
|
}
|
||||||
else { act->spr.xrepeat = act->spr.yrepeat = 0; return; }
|
|
||||||
|
|
||||||
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR;
|
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR;
|
||||||
if ((ps[actj->PlayerIndex()].footprintcount & 1)) act->spr.cstat |= CSTAT_SPRITE_XFLIP;
|
if ((ps[actj->PlayerIndex()].footprintcount & 1)) act->spr.cstat |= CSTAT_SPRITE_XFLIP;
|
||||||
|
|
|
@ -18124,6 +18124,9 @@ int QueueFootPrint(DSWActor* actor)
|
||||||
|
|
||||||
if (TestDontStickSector(actor->sector()))
|
if (TestDontStickSector(actor->sector()))
|
||||||
return -1; // Not on special sectors you don't
|
return -1; // Not on special sectors you don't
|
||||||
|
|
||||||
|
if (!isAwayFromWall(actor, 5.25))
|
||||||
|
return -1; // not if it goes ouzside the sector
|
||||||
|
|
||||||
// So, are we like, done checking now!?
|
// So, are we like, done checking now!?
|
||||||
if (FloorBloodQueue[FloorBloodQueueHead] != nullptr)
|
if (FloorBloodQueue[FloorBloodQueueHead] != nullptr)
|
||||||
|
|
Loading…
Reference in a new issue