Core/Creature: merged some missed changes for dynamic spawn regarding despawn functionality
This commit is contained in:
1 parent
d86fc5145c
commit
1870ce04b5
2 files changed
+8
-3
No files matched your search
@@ -1938,7 +1938,7 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn, Seconds forceRespawnTimer)
|
||||
uint32 respawnDelay = m_respawnDelay;
|
||||
if (uint32 scalingMode = sWorld->getIntConfig(CONFIG_RESPAWN_DYNAMICMODE))
|
||||
GetMap()->ApplyDynamicModeRespawnScaling(this, m_spawnId, respawnDelay, scalingMode);
|
||||
m_respawnTime = time(NULL) + respawnDelay;
|
||||
m_respawnTime = GameTime::GetGameTime() + respawnDelay;
|
||||
SaveRespawnTime();
|
||||
}
|
||||
|
||||
@@ -2303,7 +2303,7 @@ void Creature::SaveRespawnTime(uint32 forceDelay, bool savetodb)
|
||||
return;
|
||||
}
|
||||
|
||||
time_t thisRespawnTime = forceDelay ? time(NULL) + forceDelay : m_respawnTime;
|
||||
time_t thisRespawnTime = forceDelay ? GameTime::GetGameTime() + forceDelay : m_respawnTime;
|
||||
GetMap()->SaveRespawnTime(SPAWN_TYPE_CREATURE, m_spawnId, GetEntry(), thisRespawnTime, GetMap()->GetZoneId(GetPhaseShift(), GetHomePosition()), Trinity::ComputeGridCoord(GetHomePosition().GetPositionX(), GetHomePosition().GetPositionY()).GetId(), savetodb && m_creatureData && m_creatureData->dbData);
|
||||
}
|
||||
|
||||
@@ -2493,6 +2493,11 @@ time_t Creature::GetRespawnTimeEx() const
|
||||
return now;
|
||||
}
|
||||
|
||||
void Creature::SetRespawnTime(uint32 respawn)
|
||||
{
|
||||
m_respawnTime = respawn ? GameTime::GetGameTime() + respawn : 0;
|
||||
}
|
||||
|
||||
void Creature::GetRespawnPosition(float &x, float &y, float &z, float* ori, float* dist) const
|
||||
{
|
||||
if (m_creatureData)
|
||||
|
||||
@@ -229,7 +229,7 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
|
||||
|
||||
time_t const& GetRespawnTime() const { return m_respawnTime; }
|
||||
time_t GetRespawnTimeEx() const;
|
||||
void SetRespawnTime(uint32 respawn) { m_respawnTime = respawn ? time(nullptr) + respawn : 0; }
|
||||
void SetRespawnTime(uint32 respawn);
|
||||
void Respawn(bool force = false);
|
||||
void SaveRespawnTime(uint32 forceDelay = 0, bool savetodb = true) override;
|
||||
|
||||
|
||||
Reference in new issue
Block a user