From f9b94802918c8f27fea5264120227cddc11cdd99 Mon Sep 17 00:00:00 2001 From: furo Date: Sun, 12 Nov 2023 23:48:36 +0100 Subject: [PATCH] Save entire character with `/lasttp`. --- src/game/server/ddracechat.cpp | 9 ++++----- src/game/server/player.h | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/game/server/ddracechat.cpp b/src/game/server/ddracechat.cpp index ecf8743fac1..882223f2990 100644 --- a/src/game/server/ddracechat.cpp +++ b/src/game/server/ddracechat.cpp @@ -1543,10 +1543,10 @@ void CGameContext::ConTele(IConsole::IResult *pResult, void *pUserData) return; Pos = pChrTo->m_Pos; } - pPlayer->LastTelePos = Pos; pSelf->Teleport(pChr, Pos); pChr->UnFreeze(); pChr->Core()->m_Vel = vec2(0, 0); + pPlayer->m_LastTeleTee.Save(pChr); } void CGameContext::ConLastTele(IConsole::IResult *pResult, void *pUserData) @@ -1568,14 +1568,13 @@ void CGameContext::ConLastTele(IConsole::IResult *pResult, void *pUserData) pSelf->SendChatTarget(pPlayer->GetCID(), "You're not in a team with /practice turned on. Note that you can't earn a rank with practice enabled."); return; } - if(!pPlayer->LastTelePos.x) + if(!pPlayer->m_LastTeleTee.GetPos().x) { pSelf->SendChatTarget(pPlayer->GetCID(), "You haven't previously teleported. Use /tp before using this command."); return; } - pSelf->Teleport(pChr, pPlayer->LastTelePos); - pChr->UnFreeze(); - pChr->Core()->m_Vel = vec2(0, 0); + pPlayer->m_LastTeleTee.Load(pChr, pChr->Team(), true); + pPlayer->Pause(CPlayer::PAUSE_NONE, true); } void CGameContext::ConPracticeUnSolo(IConsole::IResult *pResult, void *pUserData) diff --git a/src/game/server/player.h b/src/game/server/player.h index 742f4e97c64..d051d179c88 100644 --- a/src/game/server/player.h +++ b/src/game/server/player.h @@ -8,6 +8,7 @@ #include #include +#include #include "teeinfo.h" @@ -221,7 +222,7 @@ class CPlayer int m_SwapTargetsClientID; //Client ID of the swap target for the given player bool m_BirthdayAnnounced; - vec2 LastTelePos; + CSaveTee m_LastTeleTee; }; #endif