diff options
| author | Shauren <shauren.trinity@gmail.com> | 2012-02-10 10:24:56 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2012-02-10 10:24:56 +0100 |
| commit | 806733550c915eaa6733be585760c29ca7021b12 (patch) | |
| tree | 6a179f24a7d364555298d9679757741541650498 | |
| parent | 5365bd25fae59a6ae225534b779bd6c14779599a (diff) | |
Core/GameObjects: Fixed crashes in GameObject::SetLootState and GameObject::SetGoState for summoned objects
Closes #5166
| -rwxr-xr-x | src/server/game/Entities/GameObject/GameObject.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index c36dbc35249..040bd8b70dd 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -220,7 +220,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa SetGoArtKit(0); // unknown what this is SetByteValue(GAMEOBJECT_BYTES_1, 2, artKit); - + switch (goinfo->type) { @@ -1901,8 +1901,8 @@ void GameObject::SetLootState(LootState state, Unit* unit) { // 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()->go_state == GO_NOT_READY) + + if (GetGOData() && GetGOData()->go_state == GO_NOT_READY) startOpen = !startOpen; if (state == GO_ACTIVATED || state == GO_JUST_DEACTIVATED) @@ -1923,7 +1923,7 @@ 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()->go_state == GO_NOT_READY) + if (GetGOData() && GetGOData()->go_state == GO_NOT_READY) startOpen = !startOpen; if (state == GO_STATE_ACTIVE || state == GO_STATE_ACTIVE_ALTERNATIVE) @@ -1949,7 +1949,7 @@ void GameObject::EnableCollision(bool enable) { if (!m_model) return; - + /*if (enable && !GetMap()->Contains(*m_model)) GetMap()->Insert(*m_model);*/ |
