mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-08 16:52:01 +00:00
Merged https://github.com/ZDoom/gzdoom/pull/1959 (BlockingLine fix)
This commit is contained in:
parent
9535d12982
commit
bf803ce2e9
5 changed files with 13 additions and 6 deletions
|
@ -285,7 +285,7 @@ void FLevelLocals::ClearLevelData(bool fullgc)
|
||||||
auto it = GetThinkerIterator<AActor>(NAME_None, STAT_TRAVELLING);
|
auto it = GetThinkerIterator<AActor>(NAME_None, STAT_TRAVELLING);
|
||||||
for (AActor *actor = it.Next(); actor != nullptr; actor = it.Next())
|
for (AActor *actor = it.Next(); actor != nullptr; actor = it.Next())
|
||||||
{
|
{
|
||||||
actor->BlockingLine = nullptr;
|
actor->BlockingLine = actor->MovementBlockingLine = nullptr;
|
||||||
actor->BlockingFloor = actor->BlockingCeiling = actor->Blocking3DFloor = nullptr;
|
actor->BlockingFloor = actor->BlockingCeiling = actor->Blocking3DFloor = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1215,6 +1215,7 @@ public:
|
||||||
|
|
||||||
AActor *BlockingMobj; // Actor that blocked the last move
|
AActor *BlockingMobj; // Actor that blocked the last move
|
||||||
line_t *BlockingLine; // Line that blocked the last move
|
line_t *BlockingLine; // Line that blocked the last move
|
||||||
|
line_t *MovementBlockingLine; // Line that stopped the Actor's movement in P_XYMovement
|
||||||
sector_t *Blocking3DFloor; // 3D floor that blocked the last move (if any)
|
sector_t *Blocking3DFloor; // 3D floor that blocked the last move (if any)
|
||||||
sector_t *BlockingCeiling; // Sector that blocked the last move (ceiling plane slope)
|
sector_t *BlockingCeiling; // Sector that blocked the last move (ceiling plane slope)
|
||||||
sector_t *BlockingFloor; // Sector that blocked the last move (floor plane slope)
|
sector_t *BlockingFloor; // Sector that blocked the last move (floor plane slope)
|
||||||
|
|
|
@ -310,6 +310,7 @@ void AActor::Serialize(FSerializer &arc)
|
||||||
A("smokecounter", smokecounter)
|
A("smokecounter", smokecounter)
|
||||||
("blockingmobj", BlockingMobj)
|
("blockingmobj", BlockingMobj)
|
||||||
A("blockingline", BlockingLine)
|
A("blockingline", BlockingLine)
|
||||||
|
A("movementblockingline", MovementBlockingLine)
|
||||||
A("blocking3dfloor", Blocking3DFloor)
|
A("blocking3dfloor", Blocking3DFloor)
|
||||||
A("blockingceiling", BlockingCeiling)
|
A("blockingceiling", BlockingCeiling)
|
||||||
A("blockingfloor", BlockingFloor)
|
A("blockingfloor", BlockingFloor)
|
||||||
|
@ -1967,7 +1968,7 @@ static double P_XYMovement (AActor *mo, DVector2 scroll)
|
||||||
{
|
{
|
||||||
// blocked move
|
// blocked move
|
||||||
AActor *BlockingMobj = mo->BlockingMobj;
|
AActor *BlockingMobj = mo->BlockingMobj;
|
||||||
line_t *BlockingLine = mo->BlockingLine;
|
line_t *BlockingLine = mo->MovementBlockingLine = mo->BlockingLine;
|
||||||
|
|
||||||
// [ZZ]
|
// [ZZ]
|
||||||
if (!BlockingLine && !BlockingMobj) // hit floor or ceiling while XY movement - sector actions
|
if (!BlockingLine && !BlockingMobj) // hit floor or ceiling while XY movement - sector actions
|
||||||
|
@ -4038,6 +4039,7 @@ void AActor::Tick ()
|
||||||
|
|
||||||
// Handle X and Y velocities
|
// Handle X and Y velocities
|
||||||
BlockingMobj = nullptr;
|
BlockingMobj = nullptr;
|
||||||
|
MovementBlockingLine = nullptr;
|
||||||
sector_t* oldBlockingCeiling = BlockingCeiling;
|
sector_t* oldBlockingCeiling = BlockingCeiling;
|
||||||
sector_t* oldBlockingFloor = BlockingFloor;
|
sector_t* oldBlockingFloor = BlockingFloor;
|
||||||
Blocking3DFloor = nullptr;
|
Blocking3DFloor = nullptr;
|
||||||
|
|
|
@ -1539,20 +1539,21 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, LookForPlayers, P_LookForPlayers)
|
||||||
ACTION_RETURN_BOOL(P_LookForPlayers(self, allaround, params));
|
ACTION_RETURN_BOOL(P_LookForPlayers(self, allaround, params));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CheckMonsterUseSpecials(AActor *self)
|
static int CheckMonsterUseSpecials(AActor *self, line_t *blocking)
|
||||||
{
|
{
|
||||||
spechit_t spec;
|
spechit_t spec;
|
||||||
int good = 0;
|
int good = 0;
|
||||||
|
|
||||||
if (!(self->flags6 & MF6_NOTRIGGER))
|
if (!(self->flags6 & MF6_NOTRIGGER))
|
||||||
{
|
{
|
||||||
|
auto checkLine = blocking ? blocking : self->BlockingLine;
|
||||||
while (spechit.Pop (spec))
|
while (spechit.Pop (spec))
|
||||||
{
|
{
|
||||||
// [RH] let monsters push lines, as well as use them
|
// [RH] let monsters push lines, as well as use them
|
||||||
if (((self->flags4 & MF4_CANUSEWALLS) && P_ActivateLine (spec.line, self, 0, SPAC_Use)) ||
|
if (((self->flags4 & MF4_CANUSEWALLS) && P_ActivateLine (spec.line, self, 0, SPAC_Use)) ||
|
||||||
((self->flags2 & MF2_PUSHWALL) && P_ActivateLine (spec.line, self, 0, SPAC_Push)))
|
((self->flags2 & MF2_PUSHWALL) && P_ActivateLine (spec.line, self, 0, SPAC_Push)))
|
||||||
{
|
{
|
||||||
good |= spec.line == self->BlockingLine ? 1 : 2;
|
good |= spec.line == checkLine ? 1 : 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1564,8 +1565,9 @@ static int CheckMonsterUseSpecials(AActor *self)
|
||||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, CheckMonsterUseSpecials, CheckMonsterUseSpecials)
|
DEFINE_ACTION_FUNCTION_NATIVE(AActor, CheckMonsterUseSpecials, CheckMonsterUseSpecials)
|
||||||
{
|
{
|
||||||
PARAM_SELF_PROLOGUE(AActor);
|
PARAM_SELF_PROLOGUE(AActor);
|
||||||
|
PARAM_POINTER(blocking, line_t);
|
||||||
|
|
||||||
ACTION_RETURN_INT(CheckMonsterUseSpecials(self));
|
ACTION_RETURN_INT(CheckMonsterUseSpecials(self, blocking));
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_Wander, A_Wander)
|
DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_Wander, A_Wander)
|
||||||
|
@ -2055,6 +2057,7 @@ DEFINE_FIELD(AActor, lastbump)
|
||||||
DEFINE_FIELD(AActor, DesignatedTeam)
|
DEFINE_FIELD(AActor, DesignatedTeam)
|
||||||
DEFINE_FIELD(AActor, BlockingMobj)
|
DEFINE_FIELD(AActor, BlockingMobj)
|
||||||
DEFINE_FIELD(AActor, BlockingLine)
|
DEFINE_FIELD(AActor, BlockingLine)
|
||||||
|
DEFINE_FIELD(AActor, MovementBlockingLine)
|
||||||
DEFINE_FIELD(AActor, Blocking3DFloor)
|
DEFINE_FIELD(AActor, Blocking3DFloor)
|
||||||
DEFINE_FIELD(AActor, BlockingCeiling)
|
DEFINE_FIELD(AActor, BlockingCeiling)
|
||||||
DEFINE_FIELD(AActor, BlockingFloor)
|
DEFINE_FIELD(AActor, BlockingFloor)
|
||||||
|
|
|
@ -202,6 +202,7 @@ class Actor : Thinker native
|
||||||
native int DesignatedTeam;
|
native int DesignatedTeam;
|
||||||
native Actor BlockingMobj;
|
native Actor BlockingMobj;
|
||||||
native Line BlockingLine;
|
native Line BlockingLine;
|
||||||
|
native Line MovementBlockingLine;
|
||||||
native Sector Blocking3DFloor;
|
native Sector Blocking3DFloor;
|
||||||
native Sector BlockingCeiling;
|
native Sector BlockingCeiling;
|
||||||
native Sector BlockingFloor;
|
native Sector BlockingFloor;
|
||||||
|
@ -698,7 +699,7 @@ class Actor : Thinker native
|
||||||
native void CheckFakeFloorTriggers (double oldz, bool oldz_has_viewheight = false);
|
native void CheckFakeFloorTriggers (double oldz, bool oldz_has_viewheight = false);
|
||||||
native bool CheckFor3DFloorHit(double z, bool trigger);
|
native bool CheckFor3DFloorHit(double z, bool trigger);
|
||||||
native bool CheckFor3DCeilingHit(double z, bool trigger);
|
native bool CheckFor3DCeilingHit(double z, bool trigger);
|
||||||
native int CheckMonsterUseSpecials();
|
native int CheckMonsterUseSpecials(Line blocking = null);
|
||||||
|
|
||||||
native bool CheckMissileSpawn(double maxdist);
|
native bool CheckMissileSpawn(double maxdist);
|
||||||
native bool CheckPosition(Vector2 pos, bool actorsonly = false, FCheckPosition tm = null);
|
native bool CheckPosition(Vector2 pos, bool actorsonly = false, FCheckPosition tm = null);
|
||||||
|
|
Loading…
Reference in a new issue