Core/GameObjects: Handle despawning and respawning of nearby linked t…
…raps on gameobject despawn and respawn
This commit is contained in:
1 parent
93fd8f2511
commit
065b6fdc2c
3 files changed
+21
-1
No files matched your search
@@ -454,6 +454,10 @@ void GameObject::Update(uint32 diff)
|
||||
m_SkillupList.clear();
|
||||
m_usetimes = 0;
|
||||
|
||||
// If nearby linked trap exists, respawn it
|
||||
if (GameObject* linkedTrap = GetLinkedTrap())
|
||||
linkedTrap->SetLootState(GO_READY);
|
||||
|
||||
switch (GetGoType())
|
||||
{
|
||||
case GAMEOBJECT_TYPE_FISHINGNODE: // can't fish now
|
||||
@@ -637,6 +641,10 @@ void GameObject::Update(uint32 diff)
|
||||
}
|
||||
case GO_JUST_DEACTIVATED:
|
||||
{
|
||||
// If nearby linked trap exists, despawn it
|
||||
if (GameObject* linkedTrap = GetLinkedTrap())
|
||||
linkedTrap->SetLootState(GO_JUST_DEACTIVATED);
|
||||
|
||||
//if Gameobject should cast spell, then this, but some GOs (type = 10) should be destroyed
|
||||
if (GetGoType() == GAMEOBJECT_TYPE_GOOBER)
|
||||
{
|
||||
@@ -2287,6 +2295,11 @@ bool GameObject::IsLootAllowedFor(Player const* player) const
|
||||
return true;
|
||||
}
|
||||
|
||||
GameObject* GameObject::GetLinkedTrap()
|
||||
{
|
||||
return ObjectAccessor::GetGameObject(*this, m_linkedTrap);
|
||||
}
|
||||
|
||||
void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target) const
|
||||
{
|
||||
if (!target)
|
||||
|
||||
Reference in new issue
Block a user