mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-10-10 07:06:38 +08:00
fix(Core/Creature): dead creatures spawn position on respawn (#3382)
This commit is contained in:
@@ -1356,11 +1356,13 @@ bool Creature::LoadCreatureFromDB(uint32 guid, Map* map, bool addToMap, bool gri
|
||||
m_deathState = DEAD;
|
||||
if (CanFly())
|
||||
{
|
||||
float tz = map->GetHeight(GetPhaseMask(), data->posX, data->posY, data->posZ, false);
|
||||
if (data->posZ - tz > 0.1f)
|
||||
float tz = map->GetHeight(GetPhaseMask(), data->posX, data->posY, data->posZ, true, MAX_FALL_DISTANCE);
|
||||
if (data->posZ - tz > 0.1f && acore::IsValidMapCoord(tz))
|
||||
{
|
||||
Relocate(data->posX, data->posY, tz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32 curhealth;
|
||||
|
||||
@@ -2390,6 +2392,7 @@ bool Creature::HasSpell(uint32 spellID) const
|
||||
time_t Creature::GetRespawnTimeEx() const
|
||||
{
|
||||
time_t now = time(nullptr);
|
||||
|
||||
if (m_respawnTime > now)
|
||||
return m_respawnTime;
|
||||
else
|
||||
|
||||
@@ -686,7 +686,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_float_configs[CONFIG_GROUP_XP_DISTANCE] = sConfigMgr->GetFloatDefault("MaxGroupXPDistance", 74.0f);
|
||||
m_float_configs[CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE] = sConfigMgr->GetFloatDefault("MaxRecruitAFriendBonusDistance", 100.0f);
|
||||
|
||||
/// \todo Add MonsterSight and GuarderSight (with meaning) in worldserver.conf or put them as define
|
||||
/// \todo Add MonsterSight in worldserver.conf or put it as define
|
||||
m_float_configs[CONFIG_SIGHT_MONSTER] = sConfigMgr->GetFloatDefault("MonsterSight", 50);
|
||||
|
||||
if (reload)
|
||||
|
||||
Reference in New Issue
Block a user