mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 01:37:01 +00:00
Applied coding style.
This commit is contained in:
parent
f874c86052
commit
8b5d67338f
1 changed files with 24 additions and 18 deletions
|
|
@ -90,31 +90,36 @@ Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const &p, uint64 guid, u
|
|||
if(typemask & TYPEMASK_PLAYER)
|
||||
{
|
||||
obj = FindPlayer(guid);
|
||||
if(obj) return obj;
|
||||
if(obj)
|
||||
return obj;
|
||||
}
|
||||
|
||||
if(typemask & TYPEMASK_UNIT)
|
||||
{
|
||||
obj = GetCreatureOrPetOrVehicle(p,guid);
|
||||
if(obj) return obj;
|
||||
if(obj)
|
||||
return obj;
|
||||
}
|
||||
|
||||
if(typemask & TYPEMASK_GAMEOBJECT)
|
||||
{
|
||||
obj = p.GetMap()->GetGameObject(guid);
|
||||
if(obj) return obj;
|
||||
if(obj)
|
||||
return obj;
|
||||
}
|
||||
|
||||
if(typemask & TYPEMASK_DYNAMICOBJECT)
|
||||
{
|
||||
obj = p.GetMap()->GetDynamicObject(guid);
|
||||
if(obj) return obj;
|
||||
if(obj)
|
||||
return obj;
|
||||
}
|
||||
|
||||
if(typemask & TYPEMASK_ITEM && p.GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
obj = ((Player const &)p).GetItemByGuid( guid );
|
||||
if(obj) return obj;
|
||||
if(obj)
|
||||
return obj;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
@ -323,10 +328,11 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia)
|
|||
// remove corpse from player_guid -> corpse map
|
||||
RemoveCorpse(corpse);
|
||||
|
||||
// remove resurrectble corpse from grid object registry (loaded state checked into call)
|
||||
// remove resurrectable corpse from grid object registry (loaded state checked into call)
|
||||
// do not load the map if it's not loaded
|
||||
Map *map = MapManager::Instance().FindMap(corpse->GetMapId(), corpse->GetInstanceId());
|
||||
if(map) map->Remove(corpse,false);
|
||||
if(map)
|
||||
map->Remove(corpse, false);
|
||||
|
||||
// remove corpse from DB
|
||||
corpse->DeleteFromDB();
|
||||
|
|
@ -342,7 +348,7 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia)
|
|||
bones = new Corpse;
|
||||
bones->Create(corpse->GetGUIDLow());
|
||||
|
||||
for (int i = 3; i < CORPSE_END; i++) // don't overwrite guid and object type
|
||||
for (int i = 3; i < CORPSE_END; ++i) // don't overwrite guid and object type
|
||||
bones->SetUInt32Value(i, corpse->GetUInt32Value(i));
|
||||
|
||||
bones->SetGrid(corpse->GetGrid());
|
||||
|
|
@ -357,7 +363,7 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia)
|
|||
bones->SetUInt32Value(CORPSE_FIELD_FLAGS, CORPSE_FLAG_UNK2 | CORPSE_FLAG_BONES);
|
||||
bones->SetUInt64Value(CORPSE_FIELD_OWNER, 0);
|
||||
|
||||
for (int i = 0; i < EQUIPMENT_SLOT_END; i++)
|
||||
for (int i = 0; i < EQUIPMENT_SLOT_END; ++i)
|
||||
{
|
||||
if(corpse->GetUInt32Value(CORPSE_FIELD_ITEM + i))
|
||||
bones->SetUInt32Value(CORPSE_FIELD_ITEM + i, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue