Skip to content

Instantly share code, notes, and snippets.

@e000
Created August 12, 2012 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e000/3329459 to your computer and use it in GitHub Desktop.
Save e000/3329459 to your computer and use it in GitHub Desktop.
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 1d9958a..ac1393f 100755
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -138,8 +138,8 @@ void GameObject::AddToWorld()
bool toggledState = GetGOData() ? GetGOData()->go_state == GO_STATE_READY : false;
if (m_model)
GetMap()->Insert(*m_model);
- if (startOpen ^ toggledState)
- EnableCollision(false);
+
+ EnableCollision(startOpen ^ toggledState);
WorldObject::AddToWorld();
}
@@ -1923,9 +1923,9 @@ 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_ACTIVE)
startOpen = !startOpen;
-
+
if (state == GO_ACTIVATED || state == GO_JUST_DEACTIVATED)
EnableCollision(startOpen);
else if (state == GO_READY)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment