Skip to content

Commit

Permalink
Add 'Trigger on arrival' spawnflag for info_teleport_destination
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeSlave committed Jul 15, 2024
1 parent 3905966 commit a46acc5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 10 additions & 0 deletions dlls/triggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2632,6 +2632,9 @@ void CTriggerPush::Touch( CBaseEntity *pOther )
#define SF_TELEPORT_KEEPANGLES 256
#define SF_TELEPORT_KEEPVELOCITY 512

// info_teleport_destination flags
#define SF_TELEPORT_DESTINATION_TRIGGER_ON_ARRIVAL 32

class CTriggerTeleport : public CBaseTrigger
{
public:
Expand Down Expand Up @@ -2816,6 +2819,13 @@ bool CTriggerTeleport::TeleportToDestination( CBaseEntity *pOther )

pevToucher->flags &= ~FL_ONGROUND;

if (FBitSet(pentTarget->v.spawnflags, SF_TELEPORT_DESTINATION_TRIGGER_ON_ARRIVAL) &&
!FStringNull(pentTarget->v.target) &&
FClassnameIs(pentTarget, "info_teleport_destination"))
{
FireTargets(STRING(pentTarget->v.target), pOther, this);
}

return true;
}

Expand Down
8 changes: 7 additions & 1 deletion fgd/halflife.fgd
Original file line number Diff line number Diff line change
Expand Up @@ -3365,7 +3365,13 @@
@PointClass base(PlayerClass) sequence(2) studio("models/player.mdl") = info_player_start : "Player 1 start" []

@PointClass base(Targetname) size(-4 -4 -4, 4 4 4) color(200 100 50) = info_target : "Beam Target" []
@PointClass size(-16 -16 0, 16 16 72) base(Targetname) color(255 128 240) = info_teleport_destination : "Teleport destination" []
@PointClass size(-16 -16 0, 16 16 72) base(Targetname, Target) color(255 128 240) = info_teleport_destination : "Teleport destination"
[
spawnflags(Flags) =
[
32 : "Trigger on arrival" : 0 : "If ticked, info_teleport_destination will trigger its target whenever an entity is teleported here. The entity is passed as !activator to the info_teleport_destination's target."
]
]

//
// items
Expand Down

0 comments on commit a46acc5

Please sign in to comment.