From 955cbeb826ba32bea5c439a40a74b556dfa4e00d Mon Sep 17 00:00:00 2001 From: hg <4683435+hgtw@users.noreply.github.com> Date: Sun, 1 Nov 2020 19:48:36 -0500 Subject: [PATCH] Revert "Don't set member offline before linkdead" This reverts commit 8d27602aa0b3f766760f0952389c988f1b150de6. This doesn't work because a linkdead leader coming back online will toggle to offline state anyway --- zone/client.h | 2 +- zone/client_process.cpp | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/zone/client.h b/zone/client.h index 3e19b6a92..572170013 100644 --- a/zone/client.h +++ b/zone/client.h @@ -739,7 +739,7 @@ public: bool TGB() const { return tgb; } - void OnDisconnect(bool hard_disconnect, bool linkdead = false); + void OnDisconnect(bool hard_disconnect); 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 929b4006f..15dfa160f 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -559,20 +559,17 @@ 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; } - - OnDisconnect(true, true); - - if (!linkdead_timer.Enabled()) { + else if (!linkdead_timer.Enabled()) { linkdead_timer.Start(RuleI(Zone, ClientLinkdeadMS)); client_state = CLIENT_LINKDEAD; AI_Start(CLIENT_LD_TIMEOUT); @@ -691,7 +688,7 @@ bool Client::Process() { } /* Just a set of actions preformed all over in Client::Process */ -void Client::OnDisconnect(bool hard_disconnect, bool linkdead) { +void Client::OnDisconnect(bool hard_disconnect) { if(hard_disconnect) { LeaveGroup(); @@ -715,7 +712,7 @@ void Client::OnDisconnect(bool hard_disconnect, bool linkdead) { } Expedition* expedition = GetExpedition(); - if (expedition && !bZoning && !linkdead && !linkdead_timer.Enabled()) + if (expedition && !bZoning) { expedition->SetMemberStatus(this, ExpeditionMemberStatus::Offline); }