diff options
author | Spp <none@none> | 2010-04-29 23:12:16 +0200 |
---|---|---|
committer | Spp <none@none> | 2010-04-29 23:12:16 +0200 |
commit | cb0cb962831a2b0c62b0a67b750569ca3049327e (patch) | |
tree | f5638fb8695101002f77106da4264bbeaab46938 /src | |
parent | 35af94d4b57d234bc4d6e3c8ab67acb201500bae (diff) |
Warning Fixes
Code Style cleanup
Fix linux compile
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/AchievementMgr.cpp | 2 | ||||
-rw-r--r-- | src/game/CombatAI.cpp | 5 | ||||
-rw-r--r-- | src/game/CombatAI.h | 2 | ||||
-rw-r--r-- | src/game/DBCEnums.h | 8 | ||||
-rw-r--r-- | src/game/DBCStores.cpp | 2 | ||||
-rw-r--r-- | src/game/Player.cpp | 26 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 9 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 2 | ||||
-rw-r--r-- | src/game/SpellMgr.h | 4 | ||||
-rw-r--r-- | src/game/WorldSession.cpp | 6 | ||||
-rw-r--r-- | src/game/WorldSession.h | 4 | ||||
-rw-r--r-- | src/game/WorldSocket.cpp | 2 | ||||
-rw-r--r-- | src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp | 2 | ||||
-rw-r--r-- | src/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp | 2 | ||||
-rw-r--r-- | src/scripts/northrend/ulduar/ulduar/boss_freya.cpp | 2 | ||||
-rw-r--r-- | src/scripts/world/areatrigger_scripts.cpp | 2 | ||||
-rw-r--r-- | src/scripts/world/npcs_special.cpp | 2 |
17 files changed, 44 insertions, 38 deletions
diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index cb72e2b9848..779ca965358 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -1993,7 +1993,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() m_AchievementCriteriasByType[criteria->requiredType].push_back(criteria); m_AchievementCriteriaListByAchievement[criteria->referredAchievement].push_back(criteria); - if(criteria->timeLimit) + if (criteria->timeLimit) m_AchievementCriteriasByTimedType[criteria->timedType].push_back(criteria); } diff --git a/src/game/CombatAI.cpp b/src/game/CombatAI.cpp index e9babeba414..56d1e6d6a3d 100644 --- a/src/game/CombatAI.cpp +++ b/src/game/CombatAI.cpp @@ -20,6 +20,7 @@ #include "CombatAI.h" #include "SpellMgr.h" +#include "Vehicle.h" int AggressorAI::Permissible(const Creature *creature) { @@ -292,13 +293,13 @@ void AOEAI::UpdateAI(const uint32 /*diff*/) ////////////// //NOTE: VehicleAI::UpdateAI runs even while the vehicle is mounted -void VehicleAI::UpdateAI(const uint32 diff) +void VehicleAI::UpdateAI(const uint32 /*diff*/) { } void VehicleAI::Reset() { - m_vehicle->Reset(); + m_vehicle->Reset(); } void VehicleAI::OnCharmed(bool apply) diff --git a/src/game/CombatAI.h b/src/game/CombatAI.h index 1c043a1aad1..40b4273d647 100644 --- a/src/game/CombatAI.h +++ b/src/game/CombatAI.h @@ -105,7 +105,7 @@ struct VehicleAI : public CreatureAI { public: explicit VehicleAI(Creature *c) : CreatureAI(c), m_vehicle(c->GetVehicleKit()), m_IsVehicleInUse(false) {} - + void UpdateAI(const uint32 diff); static int Permissible(const Creature *); void Reset(); diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h index 3969578cd02..774c4737bda 100644 --- a/src/game/DBCEnums.h +++ b/src/game/DBCEnums.h @@ -94,10 +94,10 @@ enum AchievementCriteriaTimedTypes { ACHIEVEMENT_TIMED_TYPE_EVENT = 1, // Timer is started by internal event with id in timerStartEvent ACHIEVEMENT_TIMED_TYPE_QUEST = 2, // Timer is started by acceting quest with entry in timerStartEvent - ACHIEVEMENT_TIMED_TYPE_SPELL_CASTER = 5, // Timer is started by casting a spell with entry in timerStartEvent - ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET = 6, // Timer is started by being target of spell with entry in timerStartEvent - ACHIEVEMENT_TIMED_TYPE_CREATURE = 7, // Timer is started by killing creature with entry in timerStartEvent - ACHIEVEMENT_TIMED_TYPE_ITEM = 9, // Timer is started by using item with entry in timerStartEvent + ACHIEVEMENT_TIMED_TYPE_SPELL_CASTER = 5, // Timer is started by casting a spell with entry in timerStartEvent + ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET = 6, // Timer is started by being target of spell with entry in timerStartEvent + ACHIEVEMENT_TIMED_TYPE_CREATURE = 7, // Timer is started by killing creature with entry in timerStartEvent + ACHIEVEMENT_TIMED_TYPE_ITEM = 9, // Timer is started by using item with entry in timerStartEvent ACHIEVEMENT_TIMED_TYPE_MAX, }; diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index a58f1e070c4..aeeb3f50e68 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -413,7 +413,7 @@ void LoadDBCStores(const std::string& dataPath) if (spellDiff->SpellID[x] > 0)//don't show error if spell is <= 0, not all modes have spells and there are unknown negative values sLog.outErrorDb("spelldifficulty_dbc: spell %i at field id:%u at spellid%i does not exist in SpellStore (spell.dbc), loaded as 0", spellDiff->SpellID[x], spellDiff->ID, x); newEntry.SpellID[x] = 0;//spell was <= 0 or invalid, set to 0 - } else newEntry.SpellID[x] = spellDiff->SpellID[x]; + } else newEntry.SpellID[x] = spellDiff->SpellID[x]; } if (newEntry.SpellID[0] <= 0 || newEntry.SpellID[1] <= 0)//id0-1 must be always set! continue; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index f78ab5a5eee..9467d3edbaf 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -5940,7 +5940,7 @@ void Player::SendActionButtons(uint32 state) const sLog.outDetail("Sending Action Buttons for '%u' spec '%u'", GetGUIDLow(), m_activeSpec); WorldPacket data(SMSG_ACTION_BUTTONS, 1+(MAX_ACTION_BUTTONS*4)); - data << uint8(state); + data << uint8(state); /* state can be 0, 1, 2 0 - Looks to be sent when initial action buttons get sent, however on Trinity we use 1 since 0 had some difficulties @@ -6043,7 +6043,7 @@ ActionButton const* Player::GetActionButton(uint8 button) return &buttonItr->second; } - + bool Player::SetPosition(float x, float y, float z, float orientation, bool teleport) { if (!Unit::SetPosition(x, y, z, orientation, teleport)) @@ -12015,7 +12015,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) bool isRefundable = pSrcItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE); if (isRefundable) AlterRefundReferenceCount(pSrcItem->GetGUID(), pSrcItem->GetCount() - count); - + // change item amount before check (for unique max count check) pSrcItem->SetCount(pSrcItem->GetCount() - count); @@ -12052,7 +12052,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) bool isRefundable = pSrcItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE); if (isRefundable) AlterRefundReferenceCount(pSrcItem->GetGUID(), pSrcItem->GetCount() - count); - + // change item amount before check (for unique max count check) pSrcItem->SetCount(pSrcItem->GetCount() - count); @@ -12062,7 +12062,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) { if (isRefundable) AlterRefundReferenceCount(pSrcItem->GetGUID(), pSrcItem->GetCount() + count); - + delete pNewItem; pSrcItem->SetCount(pSrcItem->GetCount() + count); SendEquipError(msg, pSrcItem, NULL); @@ -23389,22 +23389,22 @@ void Player::UpdateSpecCount(uint8 count) uint32 curCount = GetSpecsCount(); if (curCount == count) return; - + if (m_activeSpec >= count) ActivateSpec(0); - // Copy spec data + // Copy spec data if (count > curCount) { _SaveActions(); // make sure the button list is cleaned up for (ActionButtonList::iterator itr = m_actionButtons.begin(); itr != m_actionButtons.end(); ++itr) CharacterDatabase.PExecute("INSERT INTO character_action (guid,button,action,type,spec) VALUES ('%u', '%u', '%u', '%u', '%u')", GetGUIDLow(), uint32(itr->first), uint32(itr->second.GetAction()), uint32(itr->second.GetType()), 1); - + } // Delete spec data for removed spec. else if (count < curCount) - { + { _SaveActions(); CharacterDatabase.PExecute("DELETE FROM character_action WHERE spec<>'%u' AND guid='%u'",m_activeSpec, GetGUIDLow()); m_activeSpec = 0; @@ -23541,10 +23541,10 @@ void Player::ActivateSpec(uint8 spec) m_usedTalentCount = spentTalents; InitTalentForLevel(); - if (QueryResult_AutoPtr result = + if (QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT button,action,type FROM character_action WHERE guid = '%u' AND spec = '%u' ORDER BY button", GetGUIDLow(), m_activeSpec)) _LoadActions(result); - + ResummonPetTemporaryUnSummonedIfAny(); SendActionButtons(1); @@ -23606,7 +23606,7 @@ void Player::DeleteRefundReference(uint64 it) if (itr != m_refundableItems.end()) { m_refundableItems.erase(itr); - } + } } void Player::AlterRefundReferenceCount(uint64 it, uint32 newCount) @@ -23615,5 +23615,5 @@ void Player::AlterRefundReferenceCount(uint64 it, uint32 newCount) if (itr != m_refundableItems.end()) { itr->second = newCount; - } + } }
\ No newline at end of file diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 901adfd2443..1017e7d26d3 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -558,8 +558,13 @@ void Aura::UpdateOwner(uint32 diff, WorldObject * owner) Player * modOwner = NULL; if (caster) { - if ((modOwner = caster->GetSpellModOwner()) && (modSpell = modOwner->FindCurrentSpellBySpellId(GetId()))) - modOwner->SetSpellModTakingSpell(modSpell, true); + modOwner = caster->GetSpellModOwner(); + if (modOwner) + { + modSpell = modOwner->FindCurrentSpellBySpellId(GetId()); + if (modSpell) + modOwner->SetSpellModTakingSpell(modSpell, true); + } } Update(diff, caster); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 66dba8c19a5..695eb48b34c 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4500,7 +4500,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i) case SPELLFAMILY_ROGUE: { // Fan of Knives, Hemorrhage, Ghostly Strike - if ((m_spellInfo->SpellFamilyFlags[1] & 0x40000) + if ((m_spellInfo->SpellFamilyFlags[1] & 0x40000) || (m_spellInfo->SpellFamilyFlags[0] & 0x6000000)) { // Hemorrhage diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index feb138e298d..e70385872af 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -1320,9 +1320,9 @@ class SpellMgr return false; return true; } - uint32 GetSpellDifficultyId(uint32 spellId) + uint32 GetSpellDifficultyId(uint32 spellId) { - SpellDifficultySearcherMap::const_iterator i = mSpellDifficultySearcherMap.find(spellId); + SpellDifficultySearcherMap::const_iterator i = mSpellDifficultySearcherMap.find(spellId); return i == mSpellDifficultySearcherMap.end() ? 0 : (*i).second; } void SetSpellDifficultyId(uint32 spellId, uint32 id) { mSpellDifficultySearcherMap[spellId] = id; } diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index 30688b7e915..3724d58b63d 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -180,7 +180,7 @@ bool WorldSession::Update(uint32 /*diff*/) LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); #endif*/ - + if (packet->GetOpcode() >= NUM_MSG_TYPES) { sLog.outError("SESSION: received non-existed opcode %s (0x%.4X)", @@ -287,10 +287,10 @@ bool WorldSession::Update(uint32 /*diff*/) if (!m_Socket || (ShouldLogOut(currTime) && !m_playerLoading)) LogoutPlayer(true); - ///- If necessary, kick the player from the character select screen + ///- If necessary, kick the player from the character select screen if (IsConnectionIdle()) return false; - + if (!m_Socket) return false; //Will remove this session from the world session map diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index 84c16e0ebc9..350cfa42ad3 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -284,7 +284,7 @@ class WorldSession uint32 GetLatency() const { return m_latency; } void SetLatency(uint32 latency) { m_latency = latency; } uint32 getDialogStatus(Player *pPlayer, Object* questgiver, uint32 defstatus); - + time_t m_timeOutTime; void UpdateTimeOutTime(bool b) { @@ -299,7 +299,7 @@ class WorldSession return true; return false; } - + public: // opcodes handlers diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp index ce638cf2680..d5bf4c0b490 100644 --- a/src/game/WorldSocket.cpp +++ b/src/game/WorldSocket.cpp @@ -675,7 +675,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) */ else if (opcode == CMSG_PLAYER_LOGIN) m_Session->UpdateTimeOutTime(false); - + // OK ,give the packet to WorldSession aptr.release (); // WARNINIG here we call it with locks held. diff --git a/src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp b/src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp index db151f88b8a..f14b73c0319 100644 --- a/src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp +++ b/src/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp @@ -99,7 +99,7 @@ static float afSpawnLocations[2][3]= struct boss_onyxiaAI : public ScriptedAI { - boss_onyxiaAI(Creature* pCreature) : ScriptedAI(pCreature) + boss_onyxiaAI(Creature* pCreature) : ScriptedAI(pCreature) { instance = me->GetInstanceData(); } diff --git a/src/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp b/src/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp index 04c87193561..1e60dfc6135 100644 --- a/src/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp +++ b/src/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp @@ -231,7 +231,7 @@ struct boss_tharon_jaAI : public ScriptedAI { // clean morph on players Map::PlayerList const &PlayerList = pInstance->instance->GetPlayers(); - + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) if (Player *pPlayer = i->getSource()) pPlayer->DeMorph(); diff --git a/src/scripts/northrend/ulduar/ulduar/boss_freya.cpp b/src/scripts/northrend/ulduar/ulduar/boss_freya.cpp index 4a331289044..ee995878a0e 100644 --- a/src/scripts/northrend/ulduar/ulduar/boss_freya.cpp +++ b/src/scripts/northrend/ulduar/ulduar/boss_freya.cpp @@ -53,7 +53,7 @@ enum Yells enum { - // Con-speed-atory timed achievement. + // Con-speed-atory timed achievement. // TODO Should be started when 1st trash is killed. ACHIEV_CON_SPEED_ATORY_START_EVENT = 21597, SPELL_ACHIEVEMENT_CHECK = 65074, diff --git a/src/scripts/world/areatrigger_scripts.cpp b/src/scripts/world/areatrigger_scripts.cpp index a6d5de41c2e..6caddcce5b4 100644 --- a/src/scripts/world/areatrigger_scripts.cpp +++ b/src/scripts/world/areatrigger_scripts.cpp @@ -198,7 +198,7 @@ bool AreaTrigger_at_last_rites(Player* pPlayer, const AreaTriggerEntry* pAt) WorldLocation pPosition; switch(pAt->id) - { + { case 5332: case 5338: pPosition = WorldLocation(571,3733.68,3563.25,290.812,3.665192); diff --git a/src/scripts/world/npcs_special.cpp b/src/scripts/world/npcs_special.cpp index 27e449a660d..8ede2920c9e 100644 --- a/src/scripts/world/npcs_special.cpp +++ b/src/scripts/world/npcs_special.cpp @@ -2185,7 +2185,7 @@ bool GossipHello_npc_locksmith(Player* pPlayer, Creature* pCreature) return true; } -bool GossipSelect_npc_locksmith(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +bool GossipSelect_npc_locksmith(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction) { switch(uiAction) { |