diff --git a/mp/src/game/client/momentum/ui/hud_timer.cpp b/mp/src/game/client/momentum/ui/hud_timer.cpp index 4b02dcc582..462b7af545 100644 --- a/mp/src/game/client/momentum/ui/hud_timer.cpp +++ b/mp/src/game/client/momentum/ui/hud_timer.cpp @@ -113,8 +113,6 @@ class C_Timer : public CHudElement, public Panel char stLocalized[BUFSIZELOCL], cpLocalized[BUFSIZELOCL], linearLocalized[BUFSIZELOCL], startZoneLocalized[BUFSIZELOCL], mapFinishedLocalized[BUFSIZELOCL], practiceModeLocalized[BUFSIZELOCL], noTimerLocalized[BUFSIZELOCL]; - - bool m_bPlayStartSound, m_bPlayStopSound; }; DECLARE_HUDELEMENT(C_Timer); diff --git a/mp/src/game/server/momentum/mom_player.cpp b/mp/src/game/server/momentum/mom_player.cpp index d8d79a42c1..e62bd40998 100644 --- a/mp/src/game/server/momentum/mom_player.cpp +++ b/mp/src/game/server/momentum/mom_player.cpp @@ -389,18 +389,22 @@ void CMomentumPlayer::LimitSpeedInStartZone() bool bhopGameMode = (gm.GetInt() == MOMGM_BHOP || gm.GetInt() == MOMGM_SCROLL); if (m_bInsideStartZone) { - if (GetGroundEntity() == NULL) + if (GetGroundEntity() == NULL && !g_Timer.IsPracticeMode(this)) //don't count ticks in air if we're in practice mode m_nTicksInAir++; else m_nTicksInAir = 0; - //depending on gamemode, limit speed either outright or only when player is in practice mode - if (bhopGameMode ? ((!g_Timer.IsRunning() && m_nTicksInAir > MAX_AIRTIME_TICKS) || g_Timer.IsPracticeMode(this)) : g_Timer.IsPracticeMode(this)) + + //set bhop flag to true so we can't prespeed with practice mode + if (g_Timer.IsPracticeMode(this)) m_bDidPlayerBhop = true; + + //depending on gamemode, limit speed outright when player exceeds punish vel + if (bhopGameMode && ((!g_Timer.IsRunning() && m_nTicksInAir > MAX_AIRTIME_TICKS))) { Vector velocity = GetLocalVelocity(); float PunishVelSquared = startTrigger->GetPunishSpeed()*startTrigger->GetPunishSpeed(); if (velocity.Length2DSqr() > PunishVelSquared) //more efficent to check agaisnt the square of velocity { - velocity = ((velocity / velocity.Length()) * (gpGlobals->interval_per_tick == 0.01 ? startTrigger->GetPunishSpeed() : startTrigger->GetPunishSpeed() / 2)); + velocity = (velocity / velocity.Length()) * startTrigger->GetPunishSpeed(); SetAbsVelocity(Vector(velocity.x, velocity.y, velocity.z)); } } diff --git a/mp/src/game/server/momentum/mom_triggers.cpp b/mp/src/game/server/momentum/mom_triggers.cpp index 710ee807af..7528d09fbf 100644 --- a/mp/src/game/server/momentum/mom_triggers.cpp +++ b/mp/src/game/server/momentum/mom_triggers.cpp @@ -95,7 +95,6 @@ END_DATADESC() void CTriggerTimerStart::EndTouch(CBaseEntity *pOther) { - IGameEvent *mapZoneEvent = gameeventmanager->CreateEvent("player_inside_mapzone"); if (pOther->IsPlayer()) { CMomentumPlayer *pPlayer = ToCMOMPlayer(pOther); @@ -122,13 +121,14 @@ void CTriggerTimerStart::EndTouch(CBaseEntity *pOther) } } - if (mapZoneEvent) - { - mapZoneEvent->SetBool("inside_startzone", false); - gameeventmanager->FireEvent(mapZoneEvent); - } pPlayer->m_bInsideStartZone = false; } + IGameEvent *mapZoneEvent = gameeventmanager->CreateEvent("player_inside_mapzone"); + if (mapZoneEvent) + { + mapZoneEvent->SetBool("inside_startzone", false); + gameeventmanager->FireEvent(mapZoneEvent); + } // stop thinking on end touch SetNextThink(-1); BaseClass::EndTouch(pOther); @@ -137,20 +137,13 @@ void CTriggerTimerStart::EndTouch(CBaseEntity *pOther) void CTriggerTimerStart::StartTouch(CBaseEntity *pOther) { g_Timer.SetStartTrigger(this); + if (pOther->IsPlayer()) { CMomentumPlayer *pPlayer = ToCMOMPlayer(pOther); pPlayer->m_bInsideStartZone = true; pPlayer->m_flLastJumpVel = 0; //also reset last jump velocity when we enter the start zone - IGameEvent *mapZoneEvent = gameeventmanager->CreateEvent("player_inside_mapzone"); - if (mapZoneEvent) - { - mapZoneEvent->SetBool("inside_startzone", true); - mapZoneEvent->SetBool("map_finished", false); - gameeventmanager->FireEvent(mapZoneEvent); - } - if (g_Timer.IsRunning()) { g_Timer.Stop(false); @@ -158,6 +151,13 @@ void CTriggerTimerStart::StartTouch(CBaseEntity *pOther) //lower the player's speed if they try to jump back into the start zone } } + IGameEvent *mapZoneEvent = gameeventmanager->CreateEvent("player_inside_mapzone"); + if (mapZoneEvent) + { + mapZoneEvent->SetBool("inside_startzone", true); + mapZoneEvent->SetBool("map_finished", false); + gameeventmanager->FireEvent(mapZoneEvent); + } // start thinking SetNextThink(gpGlobals->curtime); BaseClass::StartTouch(pOther);