aboutsummaryrefslogtreecommitdiff
path: root/src/game/GameObject.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-08 16:35:13 -0500
committermegamage <none@none>2009-04-08 16:35:13 -0500
commitfa0492ccce16411d20edb8928a0038e2b4e68427 (patch)
tree6c47f567cc05493ddbc9a0ff1816a574a8ff05a6 /src/game/GameObject.cpp
parent371a58404743aa7294eee0096d7884018929e87b (diff)
[7634] Fixed: select non-despawnable gameobjects base at appropriate for gameobject type dataN fields. Author: VladimirMangos
Many in world gameobject that unexpected daspawned before must now work in more expected way. In tests i not found any damage to bg gameobject work, and at least this restore expected work for non-bg dorrs//buttons broken after half-year ago patch (that has been reverted partly in this commit) --HG-- branch : trunk
Diffstat (limited to 'src/game/GameObject.cpp')
-rw-r--r--src/game/GameObject.cpp47
1 files changed, 22 insertions, 25 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index def17130372..89a03cac016 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -610,37 +610,34 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
if (!Create(guid,entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, ArtKit) )
return false;
- switch(GetGOInfo()->type)
+ if(!GetDespawnPossibility())
{
- case GAMEOBJECT_TYPE_DOOR:
- case GAMEOBJECT_TYPE_BUTTON:
- /* this code (in comment) isn't correct because in battlegrounds we need despawnable doors and buttons, pls remove
- SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN);
+ SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN);
+ m_spawnedByDefault = true;
+ m_respawnDelayTime = 0;
+ m_respawnTime = 0;
+ }
+ else
+ {
+ if(data->spawntimesecs >= 0)
+ {
m_spawnedByDefault = true;
- m_respawnDelayTime = 0;
- m_respawnTime = 0;
- break;*/
- default:
- if(data->spawntimesecs >= 0)
- {
- m_spawnedByDefault = true;
- m_respawnDelayTime = data->spawntimesecs;
- m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
+ m_respawnDelayTime = data->spawntimesecs;
+ m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
- // ready to respawn
- if(m_respawnTime && m_respawnTime <= time(NULL))
- {
- m_respawnTime = 0;
- objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
- }
- }
- else
+ // ready to respawn
+ if(m_respawnTime && m_respawnTime <= time(NULL))
{
- m_spawnedByDefault = false;
- m_respawnDelayTime = -data->spawntimesecs;
m_respawnTime = 0;
+ objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
}
- break;
+ }
+ else
+ {
+ m_spawnedByDefault = false;
+ m_respawnDelayTime = -data->spawntimesecs;
+ m_respawnTime = 0;
+ }
}
return true;