mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
Merge pull request #324 from MajorCooke/teleoverride
- Added TF_OVERRIDE to A_Teleport.
This commit is contained in:
commit
fd2bff45e6
2 changed files with 13 additions and 2 deletions
|
@ -4249,6 +4249,7 @@ enum T_Flags
|
|||
TF_NODESTFOG = 0x00000080, // Don't spawn any fog at the arrival position.
|
||||
TF_USEACTORFOG = 0x00000100, // Use the actor's TeleFogSourceType and TeleFogDestType fogs.
|
||||
TF_NOJUMP = 0x00000200, // Don't jump after teleporting.
|
||||
TF_OVERRIDE = 0x00000400, // Ignore NOTELEPORT.
|
||||
};
|
||||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Teleport)
|
||||
|
@ -4270,8 +4271,11 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Teleport)
|
|||
return;
|
||||
}
|
||||
|
||||
if (ref->flags2 & MF2_NOTELEPORT)
|
||||
if ((ref->flags2 & MF2_NOTELEPORT) && !(Flags & TF_OVERRIDE))
|
||||
{
|
||||
ACTION_SET_RESULT(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Randomly choose not to teleport like A_Srcr2Decide.
|
||||
if (Flags & TF_RANDOMDECIDE)
|
||||
|
@ -4292,15 +4296,21 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Teleport)
|
|||
}
|
||||
|
||||
DSpotState *state = DSpotState::GetSpotState();
|
||||
if (state == NULL)
|
||||
if (state == NULL)
|
||||
{
|
||||
ACTION_SET_RESULT(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TargetType)
|
||||
TargetType = PClass::FindClass("BossSpot");
|
||||
|
||||
AActor * spot = state->GetSpotWithMinMaxDistance(TargetType, ref->x, ref->y, MinDist, MaxDist);
|
||||
if (spot == NULL)
|
||||
{
|
||||
ACTION_SET_RESULT(false);
|
||||
return;
|
||||
}
|
||||
|
||||
fixed_t prevX = ref->x;
|
||||
fixed_t prevY = ref->y;
|
||||
|
|
|
@ -199,6 +199,7 @@ enum
|
|||
TF_NODESTFOG = 0x00000080, // Don't spawn any fog at the arrival position.
|
||||
TF_USEACTORFOG = 0x00000100, // Use the actor's TeleFogSourceType and TeleFogDestType fogs.
|
||||
TF_NOJUMP = 0x00000200, // Don't jump after teleporting.
|
||||
TF_OVERRIDE = 0x00000400, // Ignore NOTELEPORT.
|
||||
|
||||
TF_KEEPORIENTATION = TF_KEEPVELOCITY|TF_KEEPANGLE,
|
||||
TF_NOFOG = TF_NOSRCFOG|TF_NODESTFOG,
|
||||
|
|
Loading…
Reference in a new issue