diff options
| author | leak <leakzx@googlemail.com> | 2011-04-29 20:47:02 +0200 |
|---|---|---|
| committer | leak <leakzx@googlemail.com> | 2011-04-29 20:47:02 +0200 |
| commit | 1003f30448f1f431ef091551ba5851cf7cd2b31a (patch) | |
| tree | 9bebedb5b8bd6b4d6cf6d9daa83df90a86b1a786 /src/server/game/Entities/GameObject | |
| parent | 01a79947d56eae6ed9f47dc2b41897d77cc91f41 (diff) | |
Add spaces after commas
Diffstat (limited to 'src/server/game/Entities/GameObject')
| -rwxr-xr-x | src/server/game/Entities/GameObject/GameObject.cpp | 72 | ||||
| -rwxr-xr-x | src/server/game/Entities/GameObject/GameObject.h | 16 |
2 files changed, 44 insertions, 44 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 003c693216d..af7fe560d9d 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -100,10 +100,10 @@ void GameObject::CleanupsBeforeDelete(bool /*finalCleanup*/) // Possible crash at access to deleted GO in Unit::m_gameobj if (uint64 owner_guid = GetOwnerGUID()) { - Unit* owner = ObjectAccessor::GetUnit(*this,owner_guid); + Unit* owner = ObjectAccessor::GetUnit(*this, owner_guid); if (owner) - owner->RemoveGameObject(this,false); + owner->RemoveGameObject(this, false); else { const char * ownerType = "creature"; @@ -144,9 +144,9 @@ void GameObject::RemoveFromWorld() if (uint64 owner_guid = GetOwnerGUID()) { if (Unit * owner = GetOwner()) - owner->RemoveGameObject(this,false); + owner->RemoveGameObject(this, false); else - sLog->outError("Delete GameObject (GUID: %u Entry: %u) that have references in not found creature %u GO list. Crash possible later.",GetGUIDLow(),GetGOInfo()->entry,GUID_LOPART(owner_guid)); + sLog->outError("Delete GameObject (GUID: %u Entry: %u) that have references in not found creature %u GO list. Crash possible later.", GetGUIDLow(), GetGOInfo()->entry, GUID_LOPART(owner_guid)); } WorldObject::RemoveFromWorld(); sObjectAccessor->RemoveObject(this); @@ -158,14 +158,14 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa ASSERT(map); SetMap(map); - Relocate(x,y,z,ang); + Relocate(x, y, z, ang); if (!IsPositionValid()) { - sLog->outError("Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,name_id,x,y); + sLog->outError("Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, x, y); return false; } - SetPhaseMask(phaseMask,false); + SetPhaseMask(phaseMask, false); SetZoneScript(); if (m_zoneScript) @@ -178,7 +178,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(name_id); if (!goinfo) { - sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f",guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3); + sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f", guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3); return false; } @@ -188,14 +188,14 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa if (goinfo->type >= MAX_GAMEOBJECT_TYPE) { - sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist GO type '%u' in `gameobject_template`. It's will crash client if created.",guidlow,name_id,goinfo->type); + sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist GO type '%u' in `gameobject_template`. It's will crash client if created.", guidlow, name_id, goinfo->type); return false; } SetFloatValue(GAMEOBJECT_PARENTROTATION+0, rotation0); SetFloatValue(GAMEOBJECT_PARENTROTATION+1, rotation1); - UpdateRotationFields(rotation2,rotation3); // GAMEOBJECT_FACING, GAMEOBJECT_ROTATION, GAMEOBJECT_PARENTROTATION+2/3 + UpdateRotationFields(rotation2, rotation3); // GAMEOBJECT_FACING, GAMEOBJECT_ROTATION, GAMEOBJECT_PARENTROTATION+2/3 SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size); @@ -302,7 +302,7 @@ void GameObject::Update(uint32 diff) UpdateData udata; WorldPacket packet; - BuildValuesUpdateBlockForPlayer(&udata,caster->ToPlayer()); + BuildValuesUpdateBlockForPlayer(&udata, caster->ToPlayer()); udata.BuildPacket(&packet); caster->ToPlayer()->GetSession()->SendPacket(&packet); @@ -334,7 +334,7 @@ void GameObject::Update(uint32 diff) if (targetGuid == GetGUID()) // if linking self, never respawn (check delayed to next day) SetRespawnTime(DAY); else - m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime)+urand(5,MINUTE); // else copy time from master and add a little + m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime)+urand(5, MINUTE); // else copy time from master and add a little SaveRespawnTime(); // also save to DB immediately return; } @@ -352,7 +352,7 @@ void GameObject::Update(uint32 diff) { caster->FinishSpell(CURRENT_CHANNELED_SPELL); - WorldPacket data(SMSG_FISH_ESCAPED,0); + WorldPacket data(SMSG_FISH_ESCAPED, 0); caster->ToPlayer()->GetSession()->SendPacket(&data); } // can be delete @@ -629,12 +629,12 @@ void GameObject::getFishLoot(Loot *fishloot, Player* loot_owner) fishloot->clear(); uint32 zone, subzone; - GetZoneAndAreaId(zone,subzone); + GetZoneAndAreaId(zone, subzone); // if subzone loot exist use it if (!fishloot->FillLoot(subzone, LootTemplates_Fishing, loot_owner, true, true)) // else use zone loot (must exist in like case) - fishloot->FillLoot(zone, LootTemplates_Fishing, loot_owner,true); + fishloot->FillLoot(zone, LootTemplates_Fishing, loot_owner, true); } void GameObject::SaveToDB() @@ -687,8 +687,8 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) << m_DBTableGuid << ", " << GetEntry() << ", " << mapid << ", " - << uint32(spawnMask) << "," // cast to prevent save as symbol - << uint16(GetPhaseMask()) << "," // prevent out of range error + << uint32(spawnMask) << ", " // cast to prevent save as symbol + << uint16(GetPhaseMask()) << ", " // prevent out of range error << GetPositionX() << ", " << GetPositionY() << ", " << GetPositionZ() << ", " @@ -713,7 +713,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map) if (!data) { - sLog->outErrorDb("Gameobject (GUID: %u) not found in table `gameobject`, can't load. ",guid); + sLog->outErrorDb("Gameobject (GUID: %u) not found in table `gameobject`, can't load. ", guid); return false; } @@ -737,7 +737,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map) m_DBTableGuid = guid; if (map->GetInstanceId() != 0) guid = sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT); - if (!Create(guid,entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, artKit)) + if (!Create(guid, entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, artKit)) return false; if (data->spawntimesecs >= 0) @@ -838,7 +838,7 @@ Unit* GameObject::GetOwner() const void GameObject::SaveRespawnTime() { if (m_goData && m_goData->dbData && m_respawnTime > time(NULL) && m_spawnedByDefault) - sObjectMgr->SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime); + sObjectMgr->SaveGORespawnTime(m_DBTableGuid, GetInstanceId(), m_respawnTime); } bool GameObject::isAlwaysVisibleFor(WorldObject const* seer) const @@ -892,7 +892,7 @@ bool GameObject::ActivateToQuest(Player *pTarget) const //look for battlegroundAV for some objects which are only activated after mine gots captured by own team if (GetEntry() == BG_AV_OBJECTID_MINE_N || GetEntry() == BG_AV_OBJECTID_MINE_S) if (Battleground *bg = pTarget->GetBattleground()) - if (bg->GetTypeID(true) == BATTLEGROUND_AV && !(((BattlegroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(),pTarget->GetTeam()))) + if (bg->GetTypeID(true) == BATTLEGROUND_AV && !(((BattlegroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(), pTarget->GetTeam()))) return false; return true; } @@ -947,8 +947,8 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target) Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; - Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*target,trapEntry,range); - Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO,go_check); + Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range); + Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO, go_check); TypeContainerVisitor<Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker); cell.Visit(p, object_checker, *GetMap(), *target, range); @@ -963,7 +963,7 @@ GameObject* GameObject::LookupFishingHoleAround(float range) { GameObject* ok = NULL; - CellPair p(Trinity::ComputeCellPair(GetPositionX(),GetPositionY())); + CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY())); Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; Trinity::NearestGameObjectFishingHole u_check(*this, range); @@ -993,7 +993,7 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = f if (!time_to_restore) time_to_restore = GetGOInfo()->GetAutoCloseTime(); - SwitchDoorOrButton(true,alternative); + SwitchDoorOrButton(true, alternative); SetLootState(GO_ACTIVATED); m_cooldownTime = time(NULL) + time_to_restore; @@ -1161,7 +1161,7 @@ void GameObject::Use(Unit* user) if (itr != ChairListSlots.end()) { itr->second = player->GetGUID(); //this slot in now used by player - player->TeleportTo(GetMapId(), x_lowest, y_lowest, GetPositionZ(), GetOrientation(),TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET); + player->TeleportTo(GetMapId(), x_lowest, y_lowest, GetPositionZ(), GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET); player->SetStandState(UNIT_STAND_STATE_SIT_LOW_CHAIR+info->chair.height); return; } @@ -1269,7 +1269,7 @@ void GameObject::Use(Unit* user) case GO_READY: // ready for loot { uint32 zone, subzone; - GetZoneAndAreaId(zone,subzone); + GetZoneAndAreaId(zone, subzone); int32 zone_skill = sObjectMgr->GetFishingBaseSkillLevel(subzone); if (!zone_skill) @@ -1277,23 +1277,23 @@ void GameObject::Use(Unit* user) //provide error, no fishable zone or area should be 0 if (!zone_skill) - sLog->outErrorDb("Fishable areaId %u are not properly defined in `skill_fishing_base_level`.",subzone); + sLog->outErrorDb("Fishable areaId %u are not properly defined in `skill_fishing_base_level`.", subzone); int32 skill = player->GetSkillValue(SKILL_FISHING); int32 chance; if (skill < zone_skill) { - chance = int32(pow((double)skill/zone_skill,2) * 100); + chance = int32(pow((double)skill/zone_skill, 2) * 100); if (chance < 1) chance = 1; } else chance = 100; - int32 roll = irand(1,100); + int32 roll = irand(1, 100); - sLog->outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i",skill,zone_skill,chance,roll); + sLog->outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll); // but you will likely cause junk in areas that require a high fishing skill (not yet implemented) if (chance >= roll) @@ -1301,7 +1301,7 @@ void GameObject::Use(Unit* user) player->UpdateFishingSkill(); // prevent removing GO at spell cancel - player->RemoveGameObject(this,false); + player->RemoveGameObject(this, false); SetOwnerGUID(player->GetGUID()); //TODO: find reasonable value for fishing hole search @@ -1312,7 +1312,7 @@ void GameObject::Use(Unit* user) SetLootState(GO_JUST_DEACTIVATED); } else - player->SendLoot(GetGUID(),LOOT_FISHING); + player->SendLoot(GetGUID(), LOOT_FISHING); } // TODO: else: junk @@ -1571,7 +1571,7 @@ void GameObject::Use(Unit* user) Player* player = user->ToPlayer(); // fallback, will always work - player->TeleportTo(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(),TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET); + player->TeleportTo(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET); WorldPacket data(SMSG_ENABLE_BARBER_SHOP, 0); player->GetSession()->SendPacket(&data); @@ -1592,7 +1592,7 @@ void GameObject::Use(Unit* user) if (!spellInfo) { if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell(user->ToPlayer(), spellId, this)) - sLog->outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId,GetEntry(),GetGoType()); + sLog->outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType()); else sLog->outDebug(LOG_FILTER_OUTDOORPVP, "WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId); return; @@ -1648,7 +1648,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId) void GameObject::SendCustomAnim(uint32 anim) { - WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM,8+4); + WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM, 8+4); data << GetGUID(); data << uint32(anim); SendMessageToSet(&data, true); diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 1055342944c..2941861ef9b 100755 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -28,11 +28,11 @@ class GameObjectAI; -// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform +// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform #if defined(__GNUC__) #pragma pack(1) #else -#pragma pack(push,1) +#pragma pack(push, 1) #endif #define MAX_GAMEOBJECT_QUEST_ITEMS 6 @@ -636,11 +636,11 @@ class GameObject : public WorldObject, public GridObject<GameObject> void UpdateRotationFields(float rotation2 = 0.0f, float rotation3 = 0.0f); - void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId,language,TargetGuid); } - void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); } - void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); } - void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId,receiver); } - void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); } + void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId, language, TargetGuid); } + void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId, language, TargetGuid); } + void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId, TargetGuid); } + void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId, receiver); } + void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId, language, TargetGuid); } // overwrite WorldObject function for proper name localization const char* GetNameForLocaleIdx(LocaleConstant locale_idx) const; @@ -792,7 +792,7 @@ class GameObject : public WorldObject, public GridObject<GameObject> std::set<uint32> m_unique_users; uint32 m_usetimes; - typedef std::map<uint32,uint64> ChairSlotAndUser; + typedef std::map<uint32, uint64> ChairSlotAndUser; ChairSlotAndUser ChairListSlots; uint32 m_DBTableGuid; ///< For new or temporary gameobjects is 0 for saved it is lowguid |
