Skip to content

Commit 94709cb

Browse files
committed
Add short Eureka Effect teleport cooldown
Add a short cooldown where the player can't take their own teleporter immediately after using the Eureka Effect. Previously, teleporting to an exit with the "2-Way Teleporters" MvM upgrade would immediately teleport you back to spawn. The cooldown is the length of a level 3 teleporter recharge.
1 parent 7191ecc commit 94709cb

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/game/server/tf/tf_obj_teleporter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,10 @@ bool CObjectTeleporter::PlayerCanBeTeleported( CTFPlayer *pPlayer )
537537
if ( TFGameRules() && TFGameRules()->IsPasstimeMode() && pPlayer->m_Shared.HasPasstimeBall() )
538538
return false;
539539

540+
// If the player just used the Eureka Effect, give them time to step off the teleporter
541+
if ( pBuilder && pBuilder->entindex() == pPlayer->entindex() && pPlayer->m_flEurekaTeleportCooldown >= gpGlobals->curtime )
542+
return false;
543+
540544
return true;
541545
}
542546

src/game/server/tf/tf_player.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,6 +1610,7 @@ void CTFPlayer::TFPlayerThink()
16101610
if ( m_eEurekaTeleportTarget == EUREKA_TELEPORT_TELEPORTER_EXIT && pTeleExit && ( pTeleExit->GetState() != TELEPORTER_STATE_BUILDING ) )
16111611
{
16121612
pTeleExit->RecieveTeleportingPlayer( this );
1613+
m_flEurekaTeleportCooldown = gpGlobals->curtime + 3.f;
16131614
}
16141615
else
16151616
{
@@ -3804,6 +3805,7 @@ void CTFPlayer::Spawn()
38043805
m_purgatoryPainMultiplierTimer.Invalidate();
38053806

38063807
m_bIsTeleportingUsingEurekaEffect = false;
3808+
m_flEurekaTeleportCooldown = 0.f;
38073809

38083810
m_playerMovementStuckTimer.Invalidate();
38093811

src/game/server/tf/tf_player.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,6 +1398,7 @@ class CTFPlayer : public CBaseMultiplayerPlayer, public IHasAttributes, public I
13981398

13991399
// Wrenchmotron teleport
14001400
bool m_bIsTeleportingUsingEurekaEffect;
1401+
float m_flEurekaTeleportCooldown;
14011402

14021403
private:
14031404
void UpdateHalloween( void );

0 commit comments

Comments
 (0)