aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <none@none>2009-08-17 13:58:43 +0200
committerQAston <none@none>2009-08-17 13:58:43 +0200
commitd8554f60be899230057643c4d133bd12c11bf34f (patch)
tree70e5ae426cc29396fd0254856fcafc855376d05d /src
parent44c100ae1581febb9dd940ce1d8a3853934e6d38 (diff)
Fix negative spawntimesecs handling in gameobjects - they now start off unspawned and disappear correctly upon despawn (even if PCs aren't moving)
Quest 308 changed to not require completion of 403 (offi does not have 403 as quest, just a gossip) Quest 308 finish script changed to show unguarded barrel earlier (as it does in offi) Author of all of these: totoro. --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/GameObject.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index c3bfc1d77b9..a7443d67e6b 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -460,6 +460,7 @@ void GameObject::Update(uint32 /*p_time*/)
if(!m_spawnedByDefault)
{
m_respawnTime = 0;
+ ObjectAccessor::UpdateObjectVisibility(this);
return;
}
@@ -634,18 +635,18 @@ 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;
- if(!GetGOInfo()->GetDespawnPossibility() && !GetGOInfo()->IsDespawnAtAction())
+ if(data->spawntimesecs >= 0)
{
- SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN);
m_spawnedByDefault = true;
- m_respawnDelayTime = 0;
- m_respawnTime = 0;
- }
- else
- {
- if(data->spawntimesecs >= 0)
+
+ if(!GetGOInfo()->GetDespawnPossibility() && !GetGOInfo()->IsDespawnAtAction())
+ {
+ SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN);
+ m_respawnDelayTime = 0;
+ m_respawnTime = 0;
+ }
+ else
{
- m_spawnedByDefault = true;
m_respawnDelayTime = data->spawntimesecs;
m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
@@ -656,12 +657,12 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
}
}
- else
- {
- m_spawnedByDefault = false;
- m_respawnDelayTime = -data->spawntimesecs;
- m_respawnTime = 0;
- }
+ }
+ else
+ {
+ m_spawnedByDefault = false;
+ m_respawnDelayTime = -data->spawntimesecs;
+ m_respawnTime = 0;
}
m_goData = data;