mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Inform player about possibility to keep the hook when loading
Message is displayed when saving with an active hook
This commit is contained in:
parent
7f4ec45e9a
commit
a3702e8314
|
@ -395,6 +395,11 @@ void CSaveTee::LoadHookedPlayer(const CSaveTeam *pTeam)
|
|||
m_HookedPlayer = pTeam->m_pSavedTees[m_HookedPlayer].GetClientID();
|
||||
}
|
||||
|
||||
bool CSaveTee::IsHooking() const
|
||||
{
|
||||
return m_HookState == HOOK_GRABBED || m_HookState == HOOK_FLYING;
|
||||
}
|
||||
|
||||
CSaveTeam::CSaveTeam(IGameController *Controller)
|
||||
{
|
||||
m_pController = Controller;
|
||||
|
|
|
@ -20,6 +20,7 @@ public:
|
|||
char *GetString(const CSaveTeam *pTeam);
|
||||
int FromString(const char *String);
|
||||
void LoadHookedPlayer(const CSaveTeam *pTeam);
|
||||
bool IsHooking() const;
|
||||
vec2 GetPos() const { return m_Pos; }
|
||||
const char *GetName() const { return m_aName; }
|
||||
int GetClientID() const { return m_ClientID; }
|
||||
|
|
|
@ -687,6 +687,15 @@ void CGameTeams::ProcessSaveTeam()
|
|||
m_pSaveTeamResult[Team]->m_SaveID,
|
||||
m_pSaveTeamResult[Team]->m_SavedTeam.GetString());
|
||||
}
|
||||
for(int i = 0; i < m_pSaveTeamResult[Team]->m_SavedTeam.GetMembersCount(); i++)
|
||||
{
|
||||
if(m_pSaveTeamResult[Team]->m_SavedTeam.m_pSavedTees->IsHooking())
|
||||
{
|
||||
int ClientID = m_pSaveTeamResult[Team]->m_SavedTeam.m_pSavedTees->GetClientID();
|
||||
if(GameServer()->m_apPlayers[ClientID] != nullptr)
|
||||
GameServer()->SendChatTarget(ClientID, "Start holding the hook before loading the savegame to keep the hook");
|
||||
}
|
||||
}
|
||||
ResetSavedTeam(m_pSaveTeamResult[Team]->m_RequestingPlayer, Team);
|
||||
char aSaveID[UUID_MAXSTRSIZE];
|
||||
FormatUuid(m_pSaveTeamResult[Team]->m_SaveID, aSaveID, UUID_MAXSTRSIZE);
|
||||
|
|
Loading…
Reference in a new issue