diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Entities/GameObject/GameObject.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 08518217e26..99c9f91fb0a 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -135,7 +135,7 @@ void GameObject::AddToWorld() sObjectAccessor->AddObject(this); bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false); // The state can be changed after GameObject::Create but before GameObject::AddToWorld - bool toggledState = GetGOData() ? GetGOData()->go_state == GO_STATE_READY : false; + bool toggledState = GetGOData() ? GetGOData()->go_state != GO_STATE_READY : false; if (m_model) GetMap()->InsertGameObjectModel(*m_model); @@ -1929,7 +1929,7 @@ void GameObject::SetLootState(LootState state, Unit* unit) bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false); // Use the current go state - if (GetGoState() != GO_STATE_ACTIVE) + if (GetGoState() != GO_STATE_READY) startOpen = !startOpen; if (state == GO_ACTIVATED || state == GO_JUST_DEACTIVATED) @@ -1951,13 +1951,10 @@ void GameObject::SetGoState(GOState state) // startOpen determines whether we are going to add or remove the LoS on activation bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false); - if (GetGOData() && GetGOData()->go_state == GO_STATE_READY) - startOpen = !startOpen; + if (state != GO_STATE_READY) + startOpen = !startOpen - if (state == GO_STATE_ACTIVE || state == GO_STATE_ACTIVE_ALTERNATIVE) - EnableCollision(startOpen); - else if (state == GO_STATE_READY) - EnableCollision(!startOpen); + EnableCollision(startOpen); } } |