Show sector action boundaries on the automap like line specials are.
This commit is contained in:
parent
890233d5fe
commit
2f027504b6
3 changed files with 148 additions and 34 deletions
|
|
@ -39,6 +39,14 @@
|
|||
|
||||
IMPLEMENT_CLASS (ASectorAction)
|
||||
|
||||
ASectorAction::ASectorAction (bool activatedByUse) :
|
||||
ActivatedByUse (activatedByUse) {}
|
||||
|
||||
bool ASectorAction::IsActivatedByUse() const
|
||||
{
|
||||
return ActivatedByUse;
|
||||
}
|
||||
|
||||
void ASectorAction::Destroy ()
|
||||
{
|
||||
// Remove ourself from this sector's list of actions
|
||||
|
|
@ -102,12 +110,17 @@ bool ASectorAction::DoTriggerAction (AActor *triggerer, int activationType)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool ASectorAction::CanTrigger (AActor *triggerer) const
|
||||
{
|
||||
return special &&
|
||||
((triggerer->player && !(flags & MF_FRIENDLY)) ||
|
||||
((flags & MF_AMBUSH) && (triggerer->flags2 & MF2_MCROSS)) ||
|
||||
((flags2 & MF2_DORMANT) && (triggerer->flags2 & MF2_PCROSS)));
|
||||
}
|
||||
|
||||
bool ASectorAction::CheckTrigger (AActor *triggerer) const
|
||||
{
|
||||
if (special &&
|
||||
((triggerer->player && !(flags & MF_FRIENDLY)) ||
|
||||
((flags & MF_AMBUSH) && (triggerer->flags2 & MF2_MCROSS)) ||
|
||||
((flags2 & MF2_DORMANT) && (triggerer->flags2 & MF2_PCROSS))))
|
||||
if (CanTrigger(triggerer))
|
||||
{
|
||||
bool res = !!P_ExecuteSpecial(special, NULL, triggerer, false, args[0], args[1],
|
||||
args[2], args[3], args[4]);
|
||||
|
|
@ -196,6 +209,7 @@ class ASecActUse : public ASectorAction
|
|||
{
|
||||
DECLARE_CLASS (ASecActUse, ASectorAction)
|
||||
public:
|
||||
ASecActUse() : ASectorAction (true) {}
|
||||
bool DoTriggerAction (AActor *triggerer, int activationType);
|
||||
};
|
||||
|
||||
|
|
@ -214,6 +228,7 @@ class ASecActUseWall : public ASectorAction
|
|||
{
|
||||
DECLARE_CLASS (ASecActUseWall, ASectorAction)
|
||||
public:
|
||||
ASecActUseWall() : ASectorAction (true) {}
|
||||
bool DoTriggerAction (AActor *triggerer, int activationType);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue