diff --git a/zone/client.h b/zone/client.h index f1c231db5..e5f9ee615 100644 --- a/zone/client.h +++ b/zone/client.h @@ -738,7 +738,7 @@ public: bool TGB() const { return tgb; } - void OnDisconnect(bool hard_disconnect); + void OnDisconnect(bool hard_disconnect, bool linkdead = false); uint16 GetSkillPoints() { return m_pp.points;} void SetSkillPoints(int inp) { m_pp.points = inp;} diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 66c06559d..144bce500 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -560,17 +560,20 @@ bool Client::Process() { } if (client_state != CLIENT_LINKDEAD && !eqs->CheckState(ESTABLISHED)) { - OnDisconnect(true); LogInfo("Client linkdead: {}", name); if (Admin() > 100) { + OnDisconnect(true); if (GetMerc()) { GetMerc()->Save(); GetMerc()->Depop(); } return false; } - else if (!linkdead_timer.Enabled()) { + + OnDisconnect(true, true); + + if (!linkdead_timer.Enabled()) { linkdead_timer.Start(RuleI(Zone, ClientLinkdeadMS)); client_state = CLIENT_LINKDEAD; AI_Start(CLIENT_LD_TIMEOUT); @@ -689,7 +692,7 @@ bool Client::Process() { } /* Just a set of actions preformed all over in Client::Process */ -void Client::OnDisconnect(bool hard_disconnect) { +void Client::OnDisconnect(bool hard_disconnect, bool linkdead) { if(hard_disconnect) { LeaveGroup(); @@ -713,7 +716,7 @@ void Client::OnDisconnect(bool hard_disconnect) { } Expedition* expedition = GetExpedition(); - if (expedition && !bZoning) + if (expedition && !bZoning && !linkdead && !linkdead_timer.Enabled()) { expedition->SetMemberStatus(this, ExpeditionMemberStatus::Offline); }