Skip to content

Commit ad58742

Browse files
committed
1 parent 115fcd4 commit ad58742

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

game/mod_tf/resource/modevents.res

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,8 @@
564564
"userid" "short" // userid of the player
565565
"builderid" "short" // userid of the player who built the teleporter
566566
"dist" "float" // distance the player was teleported
567+
"exitindex" "short"
568+
"entranceindex" "short"
567569
}
568570

569571
// client only

game/quiver/info_changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Added the following Source SDK Pull Requests:
8585
- #1529: Add DevMsgs for returns in CBaseCombatWeapon::WeaponSound
8686
- #1530: Allow null caller on team_control_point's SetOwner input
8787
- #1534: Fix cleanup collect on MvM currency rest logic
88+
- #1536: Add EntIndex params to player_teleported
8889

8990
Details:
9091
- Fixed a bug where the mini-crit damage effect doesn't show up when your shield breaks.

game/quiver/resource/modevents.res

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,8 @@
564564
"userid" "short" // userid of the player
565565
"builderid" "short" // userid of the player who built the teleporter
566566
"dist" "float" // distance the player was teleported
567+
"exitindex" "short"
568+
"entranceindex" "short"
567569
}
568570

569571
// client only

src/game/server/tf/tf_obj_teleporter.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,26 @@ void CObjectTeleporter::TeleporterThink( void )
11421142

11431143
pTeleportingPlayer->SpeakConceptIfAllowed( MP_CONCEPT_TELEPORTED );
11441144

1145+
#ifdef BDSBASE
1146+
IGameEvent* event = gameeventmanager->CreateEvent("player_teleported");
1147+
if (event)
1148+
{
1149+
event->SetInt("userid", pTeleportingPlayer->GetUserID());
1150+
event->SetInt("builderid", GetBuilder() ? GetBuilder()->GetUserID() : 0);
1151+
event->SetInt("exitindex", entindex());
1152+
if (GetMatchingTeleporter())
1153+
{
1154+
event->SetFloat("dist", GetMatchingTeleporter()->GetAbsOrigin().DistTo(GetAbsOrigin()));
1155+
event->SetInt("entranceindex", GetMatchingTeleporter()->entindex());
1156+
}
1157+
else
1158+
{
1159+
event->SetFloat("dist", 0);
1160+
event->SetInt("entranceindex", 0);
1161+
}
1162+
gameeventmanager->FireEvent(event);
1163+
}
1164+
#else
11451165
IGameEvent * event = gameeventmanager->CreateEvent( "player_teleported" );
11461166
if ( event )
11471167
{
@@ -1157,6 +1177,7 @@ void CObjectTeleporter::TeleporterThink( void )
11571177
}
11581178
gameeventmanager->FireEvent( event );
11591179
}
1180+
#endif
11601181
}
11611182

11621183
// reset the pointers to the player now that we're done teleporting

0 commit comments

Comments
 (0)