Merge remote-tracking branch 'origin/master' into 4.3.4

This commit is contained in:
Nay
2012-08-23 17:25:52 +01:00
3 changed files with 17 additions and 17 deletions
@@ -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);
@@ -1930,7 +1930,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)
@@ -1952,13 +1952,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)
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);
}
}