diff --git a/dlls/triggers.cpp b/dlls/triggers.cpp index 95b0394bef..e248ff2e58 100644 --- a/dlls/triggers.cpp +++ b/dlls/triggers.cpp @@ -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: @@ -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; } diff --git a/fgd/halflife.fgd b/fgd/halflife.fgd index ed9740cf98..978b434c9a 100644 --- a/fgd/halflife.fgd +++ b/fgd/halflife.fgd @@ -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