* Corpse related cleanup (author: Hunuza)

* Avoid saving of the corpse in arenas (author: VladimirMangos)

--HG--
branch : trunk
This commit is contained in:
azazel
2010-08-06 00:15:29 +06:00
parent 4773aad26b
commit f9a51dc214
16 changed files with 34 additions and 178 deletions
-13
View File
@@ -823,19 +823,6 @@ void Map::Remove(Player *player, bool remove)
DeleteFromWorld(player);
}
bool Map::RemoveBones(uint64 guid, float x, float y)
{
if (IsRemovalGrid(x, y))
{
Corpse * corpse = sObjectAccessor.GetObjectInWorld(GetId(), x, y, guid, (Corpse*)NULL);
if (corpse && corpse->GetTypeId() == TYPEID_CORPSE && corpse->GetType() == CORPSE_BONES)
corpse->DeleteBonesFromWorld();
else
return false;
}
return true;
}
template<class T>
void
Map::Remove(T *obj, bool remove)
-2
View File
@@ -390,8 +390,6 @@ class Map : public GridRefManager<NGridType>
void AddObjectToSwitchList(WorldObject *obj, bool on);
virtual void DelayedUpdate(const uint32 diff);
virtual bool RemoveBones(uint64 guid, float x, float y);
void UpdateObjectVisibility(WorldObject* obj, Cell cell, CellPair cellpair);
void UpdateObjectsVisibilityFor(Player* player, Cell cell, CellPair cellpair);
-12
View File
@@ -87,18 +87,6 @@ void MapInstanced::RelocationNotify()
}
*/
bool MapInstanced::RemoveBones(uint64 guid, float x, float y)
{
bool remove_result = false;
for (InstancedMaps::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); ++i)
{
remove_result = remove_result || i->second->RemoveBones(guid, x, y);
}
return remove_result || Map::RemoveBones(guid,x,y);
}
void MapInstanced::UnloadAll()
{
// Unload instanced maps
-1
View File
@@ -38,7 +38,6 @@ class MapInstanced : public Map
void Update(const uint32&);
void DelayedUpdate(const uint32 diff);
//void RelocationNotify();
bool RemoveBones(uint64 guid, float x, float y);
void UnloadAll();
bool CanEnter(Player* player);
-10
View File
@@ -256,16 +256,6 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
return player->Satisfy(objmgr.GetAccessRequirement(mapid, targetDifficulty), mapid, true);
}
void MapManager::RemoveBonesFromMap(uint32 mapid, uint64 guid, float x, float y)
{
bool remove_result = _createBaseMap(mapid)->RemoveBones(guid, x, y);
if (!remove_result)
{
sLog.outDebug("Bones %u not found in world. Delete from DB also.", GUID_LOPART(guid));
}
}
void MapManager::Update(uint32 diff)
{
i_timer.Update(diff);
-1
View File
@@ -140,7 +140,6 @@ class MapManager
TransportNPCMap m_TransportNPCMap;
bool CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck = false);
void RemoveBonesFromMap(uint32 mapid, uint64 guid, float x, float y);
uint32 GenerateInstanceId() { return ++i_MaxInstanceId; }
void InitMaxInstanceId();
void InitializeVisibilityDistanceInfo();