Merge pull request #862 from fryguy503/tradeskill_lockout

Container lock inconsistent state fix
This commit is contained in:
Chris Miles 2019-09-01 16:54:22 -05:00 committed by GitHub
commit 585c07210d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;