diff options
author | Spp <none@none> | 2010-04-07 23:25:02 +0200 |
---|---|---|
committer | Spp <none@none> | 2010-04-07 23:25:02 +0200 |
commit | 2454c290b84e04bd0321ca94e0be8c8dc7eedbe8 (patch) | |
tree | b744629b9fc3004bcb717c5f95a10724df3a6a62 /src/game/Creature.cpp | |
parent | 49d05ba9aa1cd5c1f3ae96546283e6d03a037ff7 (diff) |
Code Style (game + scripts only):
"==" --> " == " (when needed)
--HG--
branch : trunk
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r-- | src/game/Creature.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 24677237ac8..1f7af300bd5 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -64,7 +64,7 @@ bool VendorItemData::RemoveItem(uint32 item_id) { for (VendorItemList::iterator i = m_items.begin(); i != m_items.end(); ++i) { - if ((*i)->item==item_id) + if ((*i)->item == item_id) { m_items.erase(i); return true; @@ -76,7 +76,7 @@ bool VendorItemData::RemoveItem(uint32 item_id) size_t VendorItemData::FindItemSlot(uint32 item_id) const { for (size_t i = 0; i < m_items.size(); ++i) - if (m_items[i]->item==item_id) + if (m_items[i]->item == item_id) return i; return m_items.size(); } @@ -84,7 +84,7 @@ size_t VendorItemData::FindItemSlot(uint32 item_id) const VendorItem const* VendorItemData::FindItem(uint32 item_id) const { for (VendorItemList::const_iterator i = m_items.begin(); i != m_items.end(); ++i) - if ((*i)->item==item_id) + if ((*i)->item == item_id) return *i; return NULL; } @@ -350,7 +350,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data) // checked at loading m_defaultMovementType = MovementGeneratorType(cinfo->MovementType); - if (!m_respawnradius && m_defaultMovementType==RANDOM_MOTION_TYPE) + if (!m_respawnradius && m_defaultMovementType == RANDOM_MOTION_TYPE) m_defaultMovementType = IDLE_MOTION_TYPE; for (uint8 i=0; i < CREATURE_MAX_SPELLS; ++i) @@ -1051,13 +1051,13 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) data.orientation = GetOrientation(); data.spawntimesecs = m_respawnDelay; // prevent add data integrity problems - data.spawndist = GetDefaultMovementType()==IDLE_MOTION_TYPE ? 0 : m_respawnradius; + data.spawndist = GetDefaultMovementType() == IDLE_MOTION_TYPE ? 0 : m_respawnradius; data.currentwaypoint = 0; data.curhealth = GetHealth(); data.curmana = GetPower(POWER_MANA); data.is_dead = m_isDeadByDefault; // prevent add data integrity problems - data.movementType = !m_respawnradius && GetDefaultMovementType()==RANDOM_MOTION_TYPE + data.movementType = !m_respawnradius && GetDefaultMovementType() == RANDOM_MOTION_TYPE ? IDLE_MOTION_TYPE : GetDefaultMovementType(); data.spawnMask = spawnMask; @@ -1320,7 +1320,7 @@ bool Creature::hasQuest(uint32 quest_id) const QuestRelations const& qr = objmgr.mCreatureQuestRelations; for (QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr) { - if (itr->second==quest_id) + if (itr->second == quest_id) return true; } return false; @@ -1331,7 +1331,7 @@ bool Creature::hasInvolvedQuest(uint32 quest_id) const QuestRelations const& qr = objmgr.mCreatureQuestInvolvedRelations; for (QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr) { - if (itr->second==quest_id) + if (itr->second == quest_id) return true; } return false; @@ -1436,7 +1436,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const float Creature::GetAttackDistance(Unit const* pl) const { float aggroRate = sWorld.getRate(RATE_CREATURE_AGGRO); - if (aggroRate==0) + if (aggroRate == 0) return 0.0f; uint32 playerlevel = pl->getLevelForTarget(this); @@ -1565,7 +1565,7 @@ void Creature::Respawn(bool force) RemoveCorpse(); - if (getDeathState()==DEAD) + if (getDeathState() == DEAD) { if (m_DBTableGuid) objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0); @@ -1759,7 +1759,7 @@ bool Creature::IsVisibleInGridForPlayer(Player const* pl) const { if (GetEntry() == VISUAL_WAYPOINT) return false; - return (isAlive() || m_deathTimer > 0 || (m_isDeadByDefault && m_deathState==CORPSE)); + return (isAlive() || m_deathTimer > 0 || (m_isDeadByDefault && m_deathState == CORPSE)); } // Dead player see live creatures near own corpse @@ -2075,7 +2075,7 @@ void Creature::SendZoneUnderAttackMessage(Player* attacker) WorldPacket data(SMSG_ZONE_UNDER_ATTACK,4); data << (uint32)GetAreaId(); - sWorld.SendGlobalMessage(&data,NULL,(enemy_team==ALLIANCE ? HORDE : ALLIANCE)); + sWorld.SendGlobalMessage(&data,NULL,(enemy_team == ALLIANCE ? HORDE : ALLIANCE)); } void Creature::SetInCombatWithZone() @@ -2272,7 +2272,7 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem) VendorItemCounts::iterator itr = m_vendorItemCounts.begin(); for (; itr != m_vendorItemCounts.end(); ++itr) - if (itr->itemId==vItem->item) + if (itr->itemId == vItem->item) break; if (itr == m_vendorItemCounts.end()) @@ -2307,7 +2307,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us VendorItemCounts::iterator itr = m_vendorItemCounts.begin(); for (; itr != m_vendorItemCounts.end(); ++itr) - if (itr->itemId==vItem->item) + if (itr->itemId == vItem->item) break; if (itr == m_vendorItemCounts.end()) |