Collision/GameObjects: Fixed LoS for all doors (open and closed). Looks like data0 for type 0 is in fact startClosed instead of startOpen
closes #5660 Signed-off-by: Subv <[email protected]>
This commit is contained in:
@@ -134,7 +134,8 @@ void GameObject::AddToWorld()
|
|||||||
|
|
||||||
sObjectAccessor->AddObject(this);
|
sObjectAccessor->AddObject(this);
|
||||||
bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false);
|
bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false);
|
||||||
bool toggledState = (GetGOData() ? GetGOData()->go_state == GO_STATE_ACTIVE : false);
|
// The state can be changed after GameObject::Create but before GameObject::AddToWorld
|
||||||
|
bool toggledState = GetGoState() == GO_STATE_READY;
|
||||||
if (m_model)
|
if (m_model)
|
||||||
GetMap()->Insert(*m_model);
|
GetMap()->Insert(*m_model);
|
||||||
if ((startOpen && !toggledState) || (!startOpen && toggledState))
|
if ((startOpen && !toggledState) || (!startOpen && toggledState))
|
||||||
@@ -1904,7 +1905,8 @@ void GameObject::SetLootState(LootState state, Unit* unit)
|
|||||||
// startOpen determines whether we are going to add or remove the LoS on activation
|
// 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);
|
bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false);
|
||||||
|
|
||||||
if (GetGOData() && GetGOData()->go_state == GO_NOT_READY)
|
// Use the current go state
|
||||||
|
if (GetGoState() == GO_STATE_ACTIVE)
|
||||||
startOpen = !startOpen;
|
startOpen = !startOpen;
|
||||||
|
|
||||||
if (state == GO_ACTIVATED || state == GO_JUST_DEACTIVATED)
|
if (state == GO_ACTIVATED || state == GO_JUST_DEACTIVATED)
|
||||||
@@ -1925,7 +1927,7 @@ void GameObject::SetGoState(GOState state)
|
|||||||
// startOpen determines whether we are going to add or remove the LoS on activation
|
// 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);
|
bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false);
|
||||||
|
|
||||||
if (GetGOData() && GetGOData()->go_state == GO_NOT_READY)
|
if (GetGOData() && GetGOData()->go_state == GO_STATE_READY)
|
||||||
startOpen = !startOpen;
|
startOpen = !startOpen;
|
||||||
|
|
||||||
if (state == GO_STATE_ACTIVE || state == GO_STATE_ACTIVE_ALTERNATIVE)
|
if (state == GO_STATE_ACTIVE || state == GO_STATE_ACTIVE_ALTERNATIVE)
|
||||||
|
|||||||
Reference in New Issue
Block a user