From 2454c290b84e04bd0321ca94e0be8c8dc7eedbe8 Mon Sep 17 00:00:00 2001 From: Spp Date: Wed, 7 Apr 2010 23:25:02 +0200 Subject: Code Style (game + scripts only): "==" --> " == " (when needed) --HG-- branch : trunk --- src/game/ObjectMgr.cpp | 88 +++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) (limited to 'src/game/ObjectMgr.cpp') diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 06c4bbf2069..ef474031481 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -939,7 +939,7 @@ void ObjectMgr::LoadCreatureAddons() // check entry ids for (uint32 i = 1; i < sCreatureDataAddonStorage.MaxEntry; ++i) if (CreatureDataAddon const* addon = sCreatureDataAddonStorage.LookupEntry(i)) - if (mCreatureDataMap.find(addon->guidOrEntry)==mCreatureDataMap.end()) + if (mCreatureDataMap.find(addon->guidOrEntry) == mCreatureDataMap.end()) sLog.outErrorDb("Creature (GUID: %u) does not exist but has a record in `creature_addon`",addon->guidOrEntry); } @@ -1336,7 +1336,7 @@ void ObjectMgr::LoadCreatures() } } - if (data.phaseMask==0) + if (data.phaseMask == 0) { sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.",guid,data.id); data.phaseMask = 1; @@ -1356,7 +1356,7 @@ void ObjectMgr::LoadCreatures() gameeventmgr.mGameEventCreatureGuids[51+50].push_back(guid2); }*/ - if (gameEvent==0 && PoolId==0) // if not this is to be managed by GameEvent System or Pool system + if (gameEvent == 0 && PoolId == 0) // if not this is to be managed by GameEvent System or Pool system AddCreatureToGrid(guid, &data); ++count; @@ -1623,7 +1623,7 @@ void ObjectMgr::LoadGameobjects() continue; } - if (data.spawntimesecs==0 && gInfo->IsDespawnAtAction()) + if (data.spawntimesecs == 0 && gInfo->IsDespawnAtAction()) { sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but gameobejct marked as despawnable at action.",guid,data.id); } @@ -1666,13 +1666,13 @@ void ObjectMgr::LoadGameobjects() continue; } - if (data.phaseMask==0) + if (data.phaseMask == 0) { sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.",guid,data.id); data.phaseMask = 1; } - if (gameEvent==0 && PoolId==0) // if not this is to be managed by GameEvent System or Pool system + if (gameEvent == 0 && PoolId == 0) // if not this is to be managed by GameEvent System or Pool system AddGameobjectToGrid(guid, &data); ++count; @@ -2183,7 +2183,7 @@ void ObjectMgr::LoadItemPrototypes() const_cast(proto)->Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; } // allowed only in special format - else if ((proto->Spells[1].SpellId==483) || (proto->Spells[1].SpellId == 55884)) + else if ((proto->Spells[1].SpellId == 483) || (proto->Spells[1].SpellId == 55884)) { sLog.outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%u)",i,1+1,proto->Spells[1].SpellId); const_cast(proto)->Spells[0].SpellId = 0; @@ -2283,7 +2283,7 @@ void ObjectMgr::LoadItemPrototypes() for (uint32 j = 0; j < sizeof(proto->BagFamily)*8; ++j) { uint32 mask = 1 << j; - if ((proto->BagFamily & mask)==0) + if ((proto->BagFamily & mask) == 0) continue; ItemBagFamilyEntry const* bf = sItemBagFamilyStore.LookupEntry(j+1); @@ -2569,7 +2569,7 @@ void ObjectMgr::LoadPetLevelInfo() PetLevelInfo*& pInfoMapEntry = petInfo[creature_id]; - if (pInfoMapEntry==NULL) + if (pInfoMapEntry == NULL) pInfoMapEntry = new PetLevelInfo[sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)]; // data for level 1 stored in [0] array element, ... @@ -2773,7 +2773,7 @@ void ObjectMgr::LoadPlayerInfo() if (!amount) { - sLog.outErrorDb("Item id %u (class %u race %u) have amount==0 in `playercreateinfo_item` table, ignoring.",item_id,current_race,current_class); + sLog.outErrorDb("Item id %u (class %u race %u) have amount == 0 in `playercreateinfo_item` table, ignoring.",item_id,current_race,current_class); continue; } @@ -3196,7 +3196,7 @@ void ObjectMgr::GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, Play return; PlayerInfo const* pInfo = &playerInfo[race][class_]; - if (pInfo->displayId_m==0 || pInfo->displayId_f==0) + if (pInfo->displayId_m == 0 || pInfo->displayId_f == 0) return; if (level <= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) @@ -3849,7 +3849,7 @@ void ObjectMgr::LoadQuests() qinfo->GetQuestId(),qinfo->SrcItemId,qinfo->SrcItemId); qinfo->SrcItemId = 0; // quest can't be done for this requirement } - else if (qinfo->SrcItemCount==0) + else if (qinfo->SrcItemCount == 0) { sLog.outErrorDb("Quest %u has `SrcItemId` = %u but `SrcItemCount` = 0, set to 1 but need fix in DB.", qinfo->GetQuestId(),qinfo->SrcItemId); @@ -3885,7 +3885,7 @@ void ObjectMgr::LoadQuests() uint32 id = qinfo->ReqItemId[j]; if (id) { - if (qinfo->ReqItemCount[j]==0) + if (qinfo->ReqItemCount[j] == 0) { sLog.outErrorDb("Quest %u has `ReqItemId%d` = %u but `ReqItemCount%d` = 0, quest can't be done.", qinfo->GetQuestId(),j+1,id,j+1); @@ -4439,7 +4439,7 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename) sLog.outErrorDb("Table `%s` has invalid talk type (datalong = %u) in SCRIPT_COMMAND_TALK for script id %u",tablename,tmp.datalong,tmp.id); continue; } - if (tmp.dataint==0) + if (tmp.dataint == 0) { sLog.outErrorDb("Table `%s` has invalid talk text id (dataint = %i) in SCRIPT_COMMAND_TALK for script id %u",tablename,tmp.dataint,tmp.id); continue; @@ -4522,11 +4522,11 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename) continue; } - if (info->type==GAMEOBJECT_TYPE_FISHINGNODE || - info->type==GAMEOBJECT_TYPE_FISHINGHOLE || - info->type==GAMEOBJECT_TYPE_DOOR || - info->type==GAMEOBJECT_TYPE_BUTTON || - info->type==GAMEOBJECT_TYPE_TRAP) + if (info->type == GAMEOBJECT_TYPE_FISHINGNODE || + info->type == GAMEOBJECT_TYPE_FISHINGHOLE || + info->type == GAMEOBJECT_TYPE_DOOR || + info->type == GAMEOBJECT_TYPE_BUTTON || + info->type == GAMEOBJECT_TYPE_TRAP) { sLog.outErrorDb("Table `%s` have gameobject type (%u) unsupported by command SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",tablename,info->id,tmp.id); continue; @@ -4539,20 +4539,20 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename) GameObjectData const* data = GetGOData(tmp.datalong); if (!data) { - sLog.outErrorDb("Table `%s` has invalid gameobject (GUID: %u) in %s for script id %u",tablename,tmp.datalong,(tmp.command==SCRIPT_COMMAND_OPEN_DOOR ? "SCRIPT_COMMAND_OPEN_DOOR" : "SCRIPT_COMMAND_CLOSE_DOOR"),tmp.id); + sLog.outErrorDb("Table `%s` has invalid gameobject (GUID: %u) in %s for script id %u",tablename,tmp.datalong,(tmp.command == SCRIPT_COMMAND_OPEN_DOOR ? "SCRIPT_COMMAND_OPEN_DOOR" : "SCRIPT_COMMAND_CLOSE_DOOR"),tmp.id); continue; } GameObjectInfo const* info = GetGameObjectInfo(data->id); if (!info) { - sLog.outErrorDb("Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in %s for script id %u",tablename,tmp.datalong,data->id,(tmp.command==SCRIPT_COMMAND_OPEN_DOOR ? "SCRIPT_COMMAND_OPEN_DOOR" : "SCRIPT_COMMAND_CLOSE_DOOR"),tmp.id); + sLog.outErrorDb("Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in %s for script id %u",tablename,tmp.datalong,data->id,(tmp.command == SCRIPT_COMMAND_OPEN_DOOR ? "SCRIPT_COMMAND_OPEN_DOOR" : "SCRIPT_COMMAND_CLOSE_DOOR"),tmp.id); continue; } if (info->type!=GAMEOBJECT_TYPE_DOOR) { - sLog.outErrorDb("Table `%s` has gameobject type (%u) non supported by command %s for script id %u",tablename,info->id,(tmp.command==SCRIPT_COMMAND_OPEN_DOOR ? "SCRIPT_COMMAND_OPEN_DOOR" : "SCRIPT_COMMAND_CLOSE_DOOR"),tmp.id); + sLog.outErrorDb("Table `%s` has gameobject type (%u) non supported by command %s for script id %u",tablename,info->id,(tmp.command == SCRIPT_COMMAND_OPEN_DOOR ? "SCRIPT_COMMAND_OPEN_DOOR" : "SCRIPT_COMMAND_CLOSE_DOOR"),tmp.id); continue; } @@ -5347,7 +5347,7 @@ uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, ui uint32 submask = 1<<((i-1)%32); // skip not taxi network nodes - if ((sTaxiNodesMask[field] & submask)==0) + if ((sTaxiNodesMask[field] & submask) == 0) continue; float dist2 = (node->x - x)*(node->x - x)+(node->y - y)*(node->y - y)+(node->z - z)*(node->z - z); @@ -5373,7 +5373,7 @@ uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, ui void ObjectMgr::GetTaxiPath(uint32 source, uint32 destination, uint32 &path, uint32 &cost) { TaxiPathSetBySource::iterator src_i = sTaxiPathSetBySource.find(source); - if (src_i==sTaxiPathSetBySource.end()) + if (src_i == sTaxiPathSetBySource.end()) { path = 0; cost = 0; @@ -5383,7 +5383,7 @@ void ObjectMgr::GetTaxiPath(uint32 source, uint32 destination, uint32 &path, uin TaxiPathSetForSource& pathSet = src_i->second; TaxiPathSetForSource::iterator dest_i = pathSet.find(destination); - if (dest_i==pathSet.end()) + if (dest_i == pathSet.end()) { path = 0; cost = 0; @@ -5556,7 +5556,7 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float MapEntry const* map = sMapStore.LookupEntry(MapId); // not need to check validity of map object; MapId _MUST_ be valid here - if (graveLow==graveUp && !map->IsBattleArena()) + if (graveLow == graveUp && !map->IsBattleArena()) { //sLog.outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.",zoneId,team); return NULL; @@ -5662,7 +5662,7 @@ GraveYardData const* ObjectMgr::FindGraveYardData(uint32 id, uint32 zoneId) for (GraveYardMap::const_iterator itr = graveLow; itr != graveUp; ++itr) { - if (itr->second.safeLocId==id) + if (itr->second.safeLocId == id) return &itr->second; } @@ -5695,7 +5695,7 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool { GraveYardMap::iterator graveLow = mGraveYardMap.lower_bound(zoneId); GraveYardMap::iterator graveUp = mGraveYardMap.upper_bound(zoneId); - if (graveLow==graveUp) + if (graveLow == graveUp) { //sLog.outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.",zoneId,team); return; @@ -5793,7 +5793,7 @@ void ObjectMgr::LoadAreaTriggerTeleports() continue; } - if (at.target_X==0 && at.target_Y==0 && at.target_Z==0) + if (at.target_X == 0 && at.target_Y == 0 && at.target_Z == 0) { sLog.outErrorDb("Area trigger (ID:%u) target coordinates not provided.",Trigger_ID); continue; @@ -7015,7 +7015,7 @@ void ObjectMgr::DeleteRespawnTimeForInstance(uint32 instance) next = itr; ++next; - if (GUID_HIPART(itr->first)==instance) + if (GUID_HIPART(itr->first) == instance) mGORespawnTimes.erase(itr); } @@ -7024,7 +7024,7 @@ void ObjectMgr::DeleteRespawnTimeForInstance(uint32 instance) next = itr; ++next; - if (GUID_HIPART(itr->first)==instance) + if (GUID_HIPART(itr->first) == instance) mCreatureRespawnTimes.erase(itr); } @@ -7250,7 +7250,7 @@ static LanguageType GetRealmLanguageType(bool create) bool isValidString(std::wstring wstr, uint32 strictMask, bool numericOrSpace, bool create = false) { - if (strictMask==0) // any language, ignore realm + if (strictMask == 0) // any language, ignore realm { if (isExtendedLatinString(wstr,numericOrSpace)) return true; @@ -7344,11 +7344,11 @@ PetNameInvalidReason ObjectMgr::CheckPetName(const std::string& name) int ObjectMgr::GetIndexForLocale(LocaleConstant loc) { - if (loc==LOCALE_enUS) + if (loc == LOCALE_enUS) return -1; for (size_t i=0; i < m_LocalForIndex.size(); ++i) - if (m_LocalForIndex[i]==loc) + if (m_LocalForIndex[i] == loc) return i; return -1; @@ -7364,11 +7364,11 @@ LocaleConstant ObjectMgr::GetLocaleForIndex(int i) int ObjectMgr::GetOrNewIndexForLocale(LocaleConstant loc) { - if (loc==LOCALE_enUS) + if (loc == LOCALE_enUS) return -1; for (size_t i=0; i < m_LocalForIndex.size(); ++i) - if (m_LocalForIndex[i]==loc) + if (m_LocalForIndex[i] == loc) return i; m_LocalForIndex.push_back(loc); @@ -7495,7 +7495,7 @@ bool ObjectMgr::LoadTrinityStrings(DatabaseType& db, char const* table, int32 mi int32 entry = fields[0].GetInt32(); - if (entry==0) + if (entry == 0) { sLog.outErrorDb("Table `%s` contain reserved entry 0, ignored.",table); continue; @@ -7549,7 +7549,7 @@ bool ObjectMgr::LoadTrinityStrings(DatabaseType& db, char const* table, int32 mi const char *ObjectMgr::GetTrinityString(int32 entry, int locale_idx) const { - // locale_idx==-1 -> default, locale_idx >= 0 in to idx+1 + // locale_idx == -1 -> default, locale_idx >= 0 in to idx+1 // Content[0] always exist if exist TrinityStringLocale if (TrinityStringLocale const *msl = GetTrinityStringLocale(entry)) { @@ -7752,7 +7752,7 @@ bool PlayerCondition::Meets(Player const * player) const { Unit::AuraApplicationMap const& auras = player->GetAppliedAuras(); for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) - if ((itr->second->GetBase()->GetSpellProto()->Attributes & 0x1000010) && itr->second->GetBase()->GetSpellProto()->SpellVisual[0]==3580) + if ((itr->second->GetBase()->GetSpellProto()->Attributes & 0x1000010) && itr->second->GetBase()->GetSpellProto()->SpellVisual[0] == 3580) return true; return false; } @@ -8180,7 +8180,7 @@ bool ObjectMgr::AddSpellToTrainer(int32 entry, int32 spell, Field *fields, std:: if (GetTalentSpellCost(spell)) { - if (talentIds->count(spell)==0) + if (talentIds->count(spell) == 0) { sLog.outErrorDb("Table `npc_trainer` has talent as learning spell %u, ignore", spell); talentIds->insert(spell); @@ -8700,7 +8700,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (!((cInfo->npcflag | ORnpcflag) & UNIT_NPC_FLAG_VENDOR)) { - if (!skip_vendors || skip_vendors->count(vendor_entry)==0) + if (!skip_vendors || skip_vendors->count(vendor_entry) == 0) { if (pl) ChatHandler(pl).SendSysMessage(LANG_COMMAND_VENDORSELECTION); @@ -8734,15 +8734,15 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (maxcount > 0 && incrtime == 0) { if (pl) - ChatHandler(pl).PSendSysMessage("MaxCount!=0 (%u) but IncrTime==0", maxcount); + ChatHandler(pl).PSendSysMessage("MaxCount!=0 (%u) but IncrTime == 0", maxcount); else sLog.outErrorDb("Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry); return false; } - else if (maxcount==0 && incrtime > 0) + else if (maxcount == 0 && incrtime > 0) { if (pl) - ChatHandler(pl).PSendSysMessage("MaxCount==0 but IncrTime<>=0"); + ChatHandler(pl).PSendSysMessage("MaxCount == 0 but IncrTime<>=0"); else sLog.outErrorDb("Table `(game_event_)npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", item_id, vendor_entry); return false; -- cgit v1.2.3