From 1aab23098a7910c27e2b70a8bad059e0975eda84 Mon Sep 17 00:00:00 2001 From: Trust Date: Tue, 18 Jun 2019 23:59:37 +0000 Subject: [PATCH] Container lock inconsistent state fix --- zone/object.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/zone/object.cpp b/zone/object.cpp index 4306c6642..df143085c 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -443,6 +443,14 @@ bool Object::Process(){ if(m_ground_spawn && respawn_timer.Check()){ RandomSpawn(true); } + + if (user != nullptr && !entity_list.GetClientByCharID(user->CharacterID())) { + m_inuse = false; + last_user = user; + user->SetTradeskillObject(nullptr); + user = nullptr; + } + return true; } @@ -554,7 +562,6 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object) ClickObjectAction_Struct* coa = (ClickObjectAction_Struct*)outapp->pBuffer; //TODO: there is prolly a better way to do this. - m_inuse = true; coa->type = m_type; coa->unknown16 = 0x0a; @@ -576,12 +583,6 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object) } } - if(sender->IsLooting()) - { - coa->open = 0x00; - user = sender; - } - sender->QueuePacket(outapp); safe_delete(outapp); @@ -590,6 +591,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object) return(false); // Starting to use this object + m_inuse = true; sender->SetTradeskillObject(this); user = sender;