Don't load movement and pause state when rescuing

This commit is contained in:
Zwelf 2020-07-02 14:02:19 +02:00
parent e39a53d379
commit 538de72c94

View file

@ -2402,8 +2402,9 @@ void CCharacter::DDRaceInit()
void CCharacter::Rescue()
{
if (m_SetSavePos && !m_Super) {
if (m_LastRescue + g_Config.m_SvRescueDelay * Server()->TickSpeed() > Server()->Tick())
if(m_SetSavePos && !m_Super)
{
if(m_LastRescue + g_Config.m_SvRescueDelay * Server()->TickSpeed() > Server()->Tick())
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "You have to wait %d seconds until you can rescue yourself", (int)((m_LastRescue + g_Config.m_SvRescueDelay * Server()->TickSpeed() - Server()->Tick()) / Server()->TickSpeed()));
@ -2411,12 +2412,13 @@ void CCharacter::Rescue()
return;
}
float StartTime = m_StartTime;
m_RescueTee.load(this, Team());
// Don't load these from saved tee:
m_Core.m_Vel = vec2(0, 0);
m_Core.m_HookState = HOOK_IDLE;
m_StartTime = StartTime;
m_SavedInput.m_Direction = 0;
m_pPlayer->Pause(CPlayer::PAUSE_NONE, true);
}
}