mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 08:06:23 +00:00
Merge branch 'master' into Playerbot
This commit is contained in:
@@ -301,9 +301,6 @@ void Creature::RemoveFromWorld()
|
||||
if (m_formation)
|
||||
sFormationMgr->RemoveCreatureFromGroup(m_formation, this);
|
||||
|
||||
if (Transport* transport = GetTransport())
|
||||
transport->RemovePassenger(this, true);
|
||||
|
||||
Unit::RemoveFromWorld();
|
||||
|
||||
if (m_spawnId)
|
||||
@@ -1827,7 +1824,25 @@ void Creature::DeleteFromDB()
|
||||
return;
|
||||
}
|
||||
|
||||
GetMap()->RemoveCreatureRespawnTime(m_spawnId);
|
||||
CreatureData const* data = sObjectMgr->GetCreatureData(m_spawnId);
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
CharacterDatabaseTransaction charTrans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
sMapMgr->DoForAllMapsWithMapId(data->mapid,
|
||||
[this, charTrans](Map* map) -> void
|
||||
{
|
||||
// despawn all active creatures, and remove their respawns
|
||||
std::vector<Creature*> toUnload;
|
||||
for (auto const& pair : Acore::Containers::MapEqualRange(map->GetCreatureBySpawnIdStore(), m_spawnId))
|
||||
toUnload.push_back(pair.second);
|
||||
for (Creature* creature : toUnload)
|
||||
map->AddObjectToRemoveList(creature);
|
||||
map->RemoveCreatureRespawnTime(m_spawnId);
|
||||
}
|
||||
);
|
||||
|
||||
sObjectMgr->DeleteCreatureData(m_spawnId);
|
||||
|
||||
WorldDatabaseTransaction trans = WorldDatabase.BeginTransaction();
|
||||
@@ -3061,10 +3076,7 @@ std::string const& Creature::GetNameForLocaleIdx(LocaleConstant loc_idx) const
|
||||
|
||||
void Creature::SetPosition(float x, float y, float z, float o)
|
||||
{
|
||||
if (!Acore::IsValidMapCoord(x, y, z, o))
|
||||
return;
|
||||
|
||||
GetMap()->CreatureRelocation(this, x, y, z, o);
|
||||
UpdatePosition(x, y, z, o, false);
|
||||
}
|
||||
|
||||
bool Creature::IsDungeonBoss() const
|
||||
|
||||
Reference in New Issue
Block a user