Applied coding style.

This commit is contained in:
tomrus88 2009-06-07 21:37:49 +04:00
parent f874c86052
commit 8b5d67338f

View file

@ -90,31 +90,36 @@ Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const &p, uint64 guid, u
if(typemask & TYPEMASK_PLAYER) if(typemask & TYPEMASK_PLAYER)
{ {
obj = FindPlayer(guid); obj = FindPlayer(guid);
if(obj) return obj; if(obj)
return obj;
} }
if(typemask & TYPEMASK_UNIT) if(typemask & TYPEMASK_UNIT)
{ {
obj = GetCreatureOrPetOrVehicle(p,guid); obj = GetCreatureOrPetOrVehicle(p,guid);
if(obj) return obj; if(obj)
return obj;
} }
if(typemask & TYPEMASK_GAMEOBJECT) if(typemask & TYPEMASK_GAMEOBJECT)
{ {
obj = p.GetMap()->GetGameObject(guid); obj = p.GetMap()->GetGameObject(guid);
if(obj) return obj; if(obj)
return obj;
} }
if(typemask & TYPEMASK_DYNAMICOBJECT) if(typemask & TYPEMASK_DYNAMICOBJECT)
{ {
obj = p.GetMap()->GetDynamicObject(guid); obj = p.GetMap()->GetDynamicObject(guid);
if(obj) return obj; if(obj)
return obj;
} }
if(typemask & TYPEMASK_ITEM && p.GetTypeId() == TYPEID_PLAYER) if(typemask & TYPEMASK_ITEM && p.GetTypeId() == TYPEID_PLAYER)
{ {
obj = ((Player const &)p).GetItemByGuid( guid ); obj = ((Player const &)p).GetItemByGuid( guid );
if(obj) return obj; if(obj)
return obj;
} }
return NULL; return NULL;
@ -323,10 +328,11 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia)
// remove corpse from player_guid -> corpse map // remove corpse from player_guid -> corpse map
RemoveCorpse(corpse); 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 // do not load the map if it's not loaded
Map *map = MapManager::Instance().FindMap(corpse->GetMapId(), corpse->GetInstanceId()); 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 // remove corpse from DB
corpse->DeleteFromDB(); corpse->DeleteFromDB();
@ -342,7 +348,7 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia)
bones = new Corpse; bones = new Corpse;
bones->Create(corpse->GetGUIDLow()); 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->SetUInt32Value(i, corpse->GetUInt32Value(i));
bones->SetGrid(corpse->GetGrid()); 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->SetUInt32Value(CORPSE_FIELD_FLAGS, CORPSE_FLAG_UNK2 | CORPSE_FLAG_BONES);
bones->SetUInt64Value(CORPSE_FIELD_OWNER, 0); 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)) if(corpse->GetUInt32Value(CORPSE_FIELD_ITEM + i))
bones->SetUInt32Value(CORPSE_FIELD_ITEM + i, 0); bones->SetUInt32Value(CORPSE_FIELD_ITEM + i, 0);