From 3dde305068cad85aeee5b283bf46e2898c6f0a15 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sat, 16 Sep 2017 13:47:19 +0200 Subject: [PATCH] Core: step 1 - starting to fix core warnings expecially from headers and some cpp files Scripts and tools in next steps --- modules/worldengine/deps/CMakeLists.txt | 8 +++++--- .../nucleus/src/Threading/DelayExecutor.h | 5 +++-- src/game/AI/CoreAI/UnitAI.h | 2 +- src/game/AI/SmartScripts/SmartScript.cpp | 8 ++++---- src/game/AI/SmartScripts/SmartScriptMgr.cpp | 14 +++++++++----- src/game/ArenaSpectator/ArenaSpectator.h | 16 ++++++++-------- src/game/Battlefield/Battlefield.cpp | 5 +++-- src/game/Battlegrounds/BattlegroundMgr.cpp | 4 ++-- src/game/Battlegrounds/BattlegroundMgr.h | 6 +++--- src/game/Battlegrounds/BattlegroundQueue.cpp | 8 ++++---- src/game/Battlegrounds/Zones/BattlegroundAB.h | 5 +++-- src/game/Battlegrounds/Zones/BattlegroundEY.h | 2 +- src/game/Battlegrounds/Zones/BattlegroundRV.cpp | 2 +- src/game/Battlegrounds/Zones/BattlegroundSA.cpp | 4 ++-- src/game/Entities/Pet/Pet.h | 5 +++-- src/game/Entities/Unit/Unit.h | 4 ++-- .../TargetedMovementGenerator.h | 4 ++-- src/scripts/Commands/cs_spectator.cpp | 6 +++--- src/scripts/Spells/spell_generic.cpp | 3 ++- src/scripts/Spells/spell_item.cpp | 2 ++ src/scripts/Spells/spell_quest.cpp | 2 ++ src/scripts/Spells/spell_shaman.cpp | 2 +- 22 files changed, 66 insertions(+), 51 deletions(-) diff --git a/modules/worldengine/deps/CMakeLists.txt b/modules/worldengine/deps/CMakeLists.txt index 79f7d420e..9b6f8c0d1 100644 --- a/modules/worldengine/deps/CMakeLists.txt +++ b/modules/worldengine/deps/CMakeLists.txt @@ -8,10 +8,12 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -if( CMAKE_COMPILER_IS_GNUCXX ) - add_definitions(--no-warnings) -elseif( MSVC ) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + string(REGEX REPLACE "/W[0-4] " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + string(REGEX REPLACE "/W[0-4] " "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") add_definitions(/W0) +else() + add_definitions(-w) endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux") diff --git a/modules/worldengine/nucleus/src/Threading/DelayExecutor.h b/modules/worldengine/nucleus/src/Threading/DelayExecutor.h index 4e588cae5..23994b1e7 100644 --- a/modules/worldengine/nucleus/src/Threading/DelayExecutor.h +++ b/modules/worldengine/nucleus/src/Threading/DelayExecutor.h @@ -26,11 +26,12 @@ class DelayExecutor : protected ACE_Task_Base private: - ACE_Message_Queue mqueue_; - ACE_Activation_Queue queue_; ACE_Method_Request* pre_svc_hook_; ACE_Method_Request* post_svc_hook_; bool activated_; + ACE_Message_Queue mqueue_; + ACE_Activation_Queue queue_; + void activated(bool s); }; diff --git a/src/game/AI/CoreAI/UnitAI.h b/src/game/AI/CoreAI/UnitAI.h index 67a9f97e8..d2c2f1f3d 100644 --- a/src/game/AI/CoreAI/UnitAI.h +++ b/src/game/AI/CoreAI/UnitAI.h @@ -107,9 +107,9 @@ struct NonTankTargetSelector : public std::unary_function struct PowerUsersSelector : public std::unary_function { Unit const* _me; + Powers const _power; float const _dist; bool const _playerOnly; - Powers const _power; PowerUsersSelector(Unit const* unit, Powers power, float dist, bool playerOnly) : _me(unit), _power(power), _dist(dist), _playerOnly(playerOnly) { } diff --git a/src/game/AI/SmartScripts/SmartScript.cpp b/src/game/AI/SmartScripts/SmartScript.cpp index 7951d39de..960cde20a 100644 --- a/src/game/AI/SmartScripts/SmartScript.cpp +++ b/src/game/AI/SmartScripts/SmartScript.cpp @@ -255,7 +255,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->SendPlaySound(e.action.sound.sound, e.action.sound.onlySelf > 0); #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SOUND: target: %s (GuidLow: %u), sound: %u, onlyself: %u", - (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), e.action.sound.sound); + (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), e.action.sound.sound, e.action.sound.onlySelf); #endif } } @@ -1088,7 +1088,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u instance->SetData64(e.action.setInstanceData64.field, targets->front()->GetGUID()); #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: %u", + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: %lu", e.action.setInstanceData64.field, targets->front()->GetGUID()); #endif delete targets; @@ -3175,7 +3175,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /* // xinef: my addition if (e.target.unitGUID.getFromHashMap) { - if (target = ObjectAccessor::GetCreature(scriptTrigger ? *scriptTrigger : *GetBaseObject(), MAKE_NEW_GUID(e.target.unitGUID.dbGuid, e.target.unitGUID.entry, HIGHGUID_UNIT))) + if ((target = ObjectAccessor::GetCreature(scriptTrigger ? *scriptTrigger : *GetBaseObject(), MAKE_NEW_GUID(e.target.unitGUID.dbGuid, e.target.unitGUID.entry, HIGHGUID_UNIT)))) l->push_back(target); } else @@ -3198,7 +3198,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /* // xinef: my addition if (e.target.goGUID.getFromHashMap) { - if (target = ObjectAccessor::GetGameObject(scriptTrigger ? *scriptTrigger : *GetBaseObject(), MAKE_NEW_GUID(e.target.goGUID.dbGuid, e.target.goGUID.entry, HIGHGUID_GAMEOBJECT))) + if ((target = ObjectAccessor::GetGameObject(scriptTrigger ? *scriptTrigger : *GetBaseObject(), MAKE_NEW_GUID(e.target.goGUID.dbGuid, e.target.goGUID.entry, HIGHGUID_GAMEOBJECT)))) l->push_back(target); } else diff --git a/src/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/game/AI/SmartScripts/SmartScriptMgr.cpp index c95c655b8..3af8f9adc 100644 --- a/src/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -237,6 +237,8 @@ void SmartAIMgr::LoadSmartAIFromDB() if (temp.event.friendlyCC.repeatMin == 0 && temp.event.friendlyCC.repeatMax == 0) temp.event.event_flags |= SMART_EVENT_FLAG_NOT_REPEATABLE; break; + default: + break; } // xinef: rozpierdol tc, niedojeby ze szok @@ -416,8 +418,10 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; case SMART_EVENT_OOC_LOS: case SMART_EVENT_IC_LOS: - if (!IsMinMaxValid(e, e.event.los.cooldownMin, e.event.los.cooldownMax)) + if (!IsMinMaxValid(e, e.event.los.cooldownMin, e.event.los.cooldownMax)) { return false; + } + break; case SMART_EVENT_RESPAWN: if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_MAP && !sMapStore.LookupEntry(e.event.respawn.map)) @@ -971,14 +975,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); if (eventId < 1 || eventId >= events.size()) { - sLog->outError("SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses non-existent event, eventId %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStop); + sLog->outError("SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses non-existent event, eventId %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStop.id); return false; } GameEventData const& eventData = events[eventId]; if (!eventData.isValid()) { - sLog->outError("SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses non-existent event, eventId %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStop); + sLog->outError("SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses non-existent event, eventId %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStop.id); return false; } break; @@ -991,14 +995,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); if (eventId < 1 || eventId >= events.size()) { - sLog->outError("SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses non-existent event, eventId %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStart); + sLog->outError("SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses non-existent event, eventId %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStart.id); return false; } GameEventData const& eventData = events[eventId]; if (!eventData.isValid()) { - sLog->outError("SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses non-existent event, eventId %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStart); + sLog->outError("SmartAIMgr: Entry %u SourceType %u Event %u Action %u uses non-existent event, eventId %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStart.id); return false; } break; diff --git a/src/game/ArenaSpectator/ArenaSpectator.h b/src/game/ArenaSpectator/ArenaSpectator.h index d9c9dc6b4..3901c453d 100644 --- a/src/game/ArenaSpectator/ArenaSpectator.h +++ b/src/game/ArenaSpectator/ArenaSpectator.h @@ -92,7 +92,7 @@ namespace ArenaSpectator { if (!IS_PLAYER_GUID(targetGUID)) return; - SendCommand(o, "%s0x%016llX;%s=%s;", SPECTATOR_ADDON_PREFIX, targetGUID, prefix, c); + SendCommand(o, "%s0x%016lX;%s=%s;", SPECTATOR_ADDON_PREFIX, targetGUID, prefix, c); } template @@ -100,7 +100,7 @@ namespace ArenaSpectator { if (!IS_PLAYER_GUID(targetGUID)) return; - SendCommand(o, "%s0x%016llX;%s=%u;", SPECTATOR_ADDON_PREFIX, targetGUID, prefix, t); + SendCommand(o, "%s0x%016lX;%s=%u;", SPECTATOR_ADDON_PREFIX, targetGUID, prefix, t); } template @@ -108,7 +108,7 @@ namespace ArenaSpectator { if (!IS_PLAYER_GUID(targetGUID)) return; - SendCommand(o, "%s0x%016llX;%s=0x%016llX;", SPECTATOR_ADDON_PREFIX, targetGUID, prefix, t); + SendCommand(o, "%s0x%016lX;%s=0x%016lX;", SPECTATOR_ADDON_PREFIX, targetGUID, prefix, t); } template @@ -116,7 +116,7 @@ namespace ArenaSpectator { if (!IS_PLAYER_GUID(targetGUID)) return; - SendCommand(o, "%s0x%016llX;%s=%u,%i;", SPECTATOR_ADDON_PREFIX, targetGUID, prefix, id, casttime); + SendCommand(o, "%s0x%016lX;%s=%u,%i;", SPECTATOR_ADDON_PREFIX, targetGUID, prefix, id, casttime); } template @@ -127,7 +127,7 @@ namespace ArenaSpectator if (const SpellInfo* si = sSpellMgr->GetSpellInfo(id)) if (si->SpellIconID == 1) return; - SendCommand(o, "%s0x%016llX;%s=%u,%u,%u;", SPECTATOR_ADDON_PREFIX, targetGUID, prefix, id, dur, maxdur); + SendCommand(o, "%s0x%016lX;%s=%u,%u,%u;", SPECTATOR_ADDON_PREFIX, targetGUID, prefix, id, dur, maxdur); } template @@ -135,7 +135,7 @@ namespace ArenaSpectator { if (!IS_PLAYER_GUID(targetGUID)) return; - SendCommand(o, "%s0x%016llX;%s=%u,%u,%i,%i,%u,%u,%u,0x%016llX;", SPECTATOR_ADDON_PREFIX, targetGUID, prefix, remove ? 1 : 0, stack, dur, maxdur, id, dispel, isDebuff ? 1 : 0, caster); + SendCommand(o, "%s0x%016lX;%s=%u,%u,%i,%i,%u,%u,%u,0x%016lX;", SPECTATOR_ADDON_PREFIX, targetGUID, prefix, remove ? 1 : 0, stack, dur, maxdur, id, dispel, isDebuff ? 1 : 0, caster); } void HandleResetCommand(Player* p) @@ -205,8 +205,8 @@ namespace ArenaSpectator if (effMask & (1<GetEffect(i)->GetAuraType(); - if (aura->GetEffect(i)->GetAmount() && (aura->GetSpellInfo()->IsPositive() || targetGUID != aura->GetCasterGUID()) || - at == SPELL_AURA_MECHANIC_IMMUNITY || at == SPELL_AURA_EFFECT_IMMUNITY || at == SPELL_AURA_STATE_IMMUNITY || at == SPELL_AURA_SCHOOL_IMMUNITY || at == SPELL_AURA_DISPEL_IMMUNITY) + if (aura->GetEffect(i)->GetAmount() && ((aura->GetSpellInfo()->IsPositive() || targetGUID != aura->GetCasterGUID()) || + at == SPELL_AURA_MECHANIC_IMMUNITY || at == SPELL_AURA_EFFECT_IMMUNITY || at == SPELL_AURA_STATE_IMMUNITY || at == SPELL_AURA_SCHOOL_IMMUNITY || at == SPELL_AURA_DISPEL_IMMUNITY)) return true; } } diff --git a/src/game/Battlefield/Battlefield.cpp b/src/game/Battlefield/Battlefield.cpp index 854753b6b..1ab8f8c2e 100644 --- a/src/game/Battlefield/Battlefield.cpp +++ b/src/game/Battlefield/Battlefield.cpp @@ -416,14 +416,15 @@ void Battlefield::PlayerAcceptInviteToWar(Player* player) void Battlefield::TeamCastSpell(TeamId team, int32 spellId) { - if (spellId > 0) + if (spellId > 0) { for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr) if (Player* player = ObjectAccessor::FindPlayer(*itr)) player->CastSpell(player, uint32(spellId), true); - else + } else { for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr) if (Player* player = ObjectAccessor::FindPlayer(*itr)) player->RemoveAuraFromStack(uint32(-spellId)); + } } void Battlefield::BroadcastPacketToZone(WorldPacket& data) const diff --git a/src/game/Battlegrounds/BattlegroundMgr.cpp b/src/game/Battlegrounds/BattlegroundMgr.cpp index 3a1e0c2c6..28c0d1abd 100644 --- a/src/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/game/Battlegrounds/BattlegroundMgr.cpp @@ -39,8 +39,8 @@ /*** BATTLEGROUND MANAGER ***/ /*********************************************************/ -BattlegroundMgr::BattlegroundMgr() : m_ArenaTesting(false), m_Testing(false), - m_lastClientVisibleInstanceId(0), m_NextAutoDistributionTime(0), m_NextPeriodicQueueUpdateTime(5*IN_MILLISECONDS), randomBgDifficultyEntry(999, 0, 80, 80, 0) +BattlegroundMgr::BattlegroundMgr() : randomBgDifficultyEntry(999, 0, 80, 80, 0), m_ArenaTesting(false), m_Testing(false), + m_lastClientVisibleInstanceId(0), m_NextAutoDistributionTime(0), m_NextPeriodicQueueUpdateTime(5*IN_MILLISECONDS) { for (uint32 qtype = BATTLEGROUND_QUEUE_NONE; qtype < MAX_BATTLEGROUND_QUEUE_TYPES; ++qtype) m_BattlegroundQueues[qtype].SetBgTypeIdAndArenaType(BGTemplateId(BattlegroundQueueTypeId(qtype)), BGArenaType(BattlegroundQueueTypeId(qtype))); diff --git a/src/game/Battlegrounds/BattlegroundMgr.h b/src/game/Battlegrounds/BattlegroundMgr.h index 54279b252..48482b799 100644 --- a/src/game/Battlegrounds/BattlegroundMgr.h +++ b/src/game/Battlegrounds/BattlegroundMgr.h @@ -142,11 +142,11 @@ class BattlegroundMgr BattlegroundQueue m_BattlegroundQueues[MAX_BATTLEGROUND_QUEUE_TYPES]; std::vector m_ArenaQueueUpdateScheduler; - uint32 m_lastClientVisibleInstanceId; - uint32 m_NextPeriodicQueueUpdateTime; - time_t m_NextAutoDistributionTime; bool m_ArenaTesting; bool m_Testing; + uint32 m_lastClientVisibleInstanceId; + time_t m_NextAutoDistributionTime; + uint32 m_NextPeriodicQueueUpdateTime; BattleMastersMap mBattleMastersMap; }; diff --git a/src/game/Battlegrounds/BattlegroundQueue.cpp b/src/game/Battlegrounds/BattlegroundQueue.cpp index db417449a..6a22a720a 100644 --- a/src/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/game/Battlegrounds/BattlegroundQueue.cpp @@ -391,8 +391,8 @@ void BattlegroundQueue::FillPlayersToBG(const int32 aliFree, const int32 hordeFr // quick check if nothing we can do: if (!sBattlegroundMgr->isTesting()) - if (aliFree > hordeFree && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].empty() || - hordeFree > aliFree && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].empty()) + if ((aliFree > hordeFree && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].empty()) || + (hordeFree > aliFree && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].empty())) return; // ally: at first fill as much as possible @@ -447,8 +447,8 @@ void BattlegroundQueue::FillPlayersToBGWithSpecific(const int32 aliFree, const i // quick check if nothing we can do: if (!sBattlegroundMgr->isTesting()) - if (m_QueuedGroups[thisBracketId][BG_QUEUE_NORMAL_ALLIANCE].empty() && specificQueue->m_QueuedGroups[specificBracketId][BG_QUEUE_NORMAL_ALLIANCE].empty() || - m_QueuedGroups[thisBracketId][BG_QUEUE_NORMAL_HORDE].empty() && specificQueue->m_QueuedGroups[specificBracketId][BG_QUEUE_NORMAL_HORDE].empty()) + if ((m_QueuedGroups[thisBracketId][BG_QUEUE_NORMAL_ALLIANCE].empty() && specificQueue->m_QueuedGroups[specificBracketId][BG_QUEUE_NORMAL_ALLIANCE].empty()) || + (m_QueuedGroups[thisBracketId][BG_QUEUE_NORMAL_HORDE].empty() && specificQueue->m_QueuedGroups[specificBracketId][BG_QUEUE_NORMAL_HORDE].empty())) return; // copy groups from both queues to new joined container diff --git a/src/game/Battlegrounds/Zones/BattlegroundAB.h b/src/game/Battlegrounds/Zones/BattlegroundAB.h index 203701247..ddb5ba5d8 100644 --- a/src/game/Battlegrounds/Zones/BattlegroundAB.h +++ b/src/game/Battlegrounds/Zones/BattlegroundAB.h @@ -261,10 +261,11 @@ class BattlegroundAB : public Battleground { } - uint8 _state; + TeamId _ownerTeamId; uint32 _iconNone; uint32 _iconCapture; - TeamId _ownerTeamId; + uint8 _state; + bool _captured; }; diff --git a/src/game/Battlegrounds/Zones/BattlegroundEY.h b/src/game/Battlegrounds/Zones/BattlegroundEY.h index 97993e557..5d9695352 100644 --- a/src/game/Battlegrounds/Zones/BattlegroundEY.h +++ b/src/game/Battlegrounds/Zones/BattlegroundEY.h @@ -377,8 +377,8 @@ class BattlegroundEY : public Battleground } TeamId _ownerTeamId; - uint32 _areaTrigger; int8 _barStatus; + uint32 _areaTrigger; int8 _playersCount[BG_TEAMS_COUNT]; bool IsUnderControl(TeamId teamId) const { return _ownerTeamId == teamId; } diff --git a/src/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/game/Battlegrounds/Zones/BattlegroundRV.cpp index 590b45e70..1936da03c 100644 --- a/src/game/Battlegrounds/Zones/BattlegroundRV.cpp +++ b/src/game/Battlegrounds/Zones/BattlegroundRV.cpp @@ -47,7 +47,7 @@ void BattlegroundRV::CheckPositionForUnit(Unit* unit) { float groundZ_vmap = unit->GetMap()->GetHeight(unit->GetPositionX(), unit->GetPositionY(), 37.0f, true, 50.0f); float groundZ_dyntree = unit->GetMap()->GetDynamicMapTree().getHeight(unit->GetPositionX(), unit->GetPositionY(), 37.0f, 50.0f, unit->GetPhaseMask()); - if (groundZ_vmap > 28.0f && groundZ_vmap < 29.0f || groundZ_dyntree > 28.0f && groundZ_dyntree < 37.0f) + if ((groundZ_vmap > 28.0f && groundZ_vmap < 29.0f) || (groundZ_dyntree > 28.0f && groundZ_dyntree < 37.0f)) { float groundZ = std::max(groundZ_vmap, groundZ_dyntree); if (unit->GetPositionZ() < groundZ - 0.2f || unit->GetPositionZ() > groundZ + 3.5f) diff --git a/src/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/game/Battlegrounds/Zones/BattlegroundSA.cpp index 9eda5f4b4..6f2c2a6d5 100644 --- a/src/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -624,9 +624,9 @@ void BattlegroundSA::EventPlayerDamagedGO(Player* /*player*/, GameObject* go, ui case BG_SA_GREEN_GATE: { GameObject* go = NULL; - if (go = GetBGObject(BG_SA_RED_GATE)) + if ((go = GetBGObject(BG_SA_RED_GATE))) go->SetDestructibleBuildingModifyState(true); - if (go = GetBGObject(BG_SA_PURPLE_GATE)) + if ((go = GetBGObject(BG_SA_PURPLE_GATE))) go->SetDestructibleBuildingModifyState(true); break; } diff --git a/src/game/Entities/Pet/Pet.h b/src/game/Entities/Pet/Pet.h index 9578a4ebe..65f7735ec 100644 --- a/src/game/Entities/Pet/Pet.h +++ b/src/game/Entities/Pet/Pet.h @@ -28,10 +28,11 @@ class AsynchPetSummon AsynchPetSummon(uint32 entry, Position position, PetType petType, uint32 duration, uint32 createdBySpell, uint64 casterGUID) : m_entry(entry), pos(position), m_petType(petType), m_duration(duration), m_createdBySpell(createdBySpell), m_casterGUID(casterGUID) { } - + + uint32 m_entry; Position pos; - uint32 m_entry, m_createdBySpell, m_duration; PetType m_petType; + uint32 m_duration, m_createdBySpell; uint64 m_casterGUID; }; diff --git a/src/game/Entities/Unit/Unit.h b/src/game/Entities/Unit/Unit.h index d622b7909..a2e29fbd5 100644 --- a/src/game/Entities/Unit/Unit.h +++ b/src/game/Entities/Unit/Unit.h @@ -1323,7 +1323,7 @@ public: class SafeUnitPointer { public: - explicit SafeUnitPointer(Unit* defVal) : defaultValue(defVal), ptr(defVal) {} + explicit SafeUnitPointer(Unit* defVal) : ptr(defVal), defaultValue(defVal) {} SafeUnitPointer(const SafeUnitPointer& p) { ASSERT(false); } void Initialize(Unit* defVal) { defaultValue = defVal; ptr = defVal; } ~SafeUnitPointer(); @@ -2368,7 +2368,7 @@ class Unit : public WorldObject // pussywizard: // MMaps std::map m_targetsNotAcceptable; - bool isTargetNotAcceptableByMMaps(uint64 guid, uint32 currTime, const Position* t = NULL) const { std::map::const_iterator itr = m_targetsNotAcceptable.find(guid); if (itr != m_targetsNotAcceptable.end() && (itr->second._endTime >= currTime || t && !itr->second.PosChanged(*this, *t))) return true; return false; } + bool isTargetNotAcceptableByMMaps(uint64 guid, uint32 currTime, const Position* t = NULL) const { std::map::const_iterator itr = m_targetsNotAcceptable.find(guid); if (itr != m_targetsNotAcceptable.end() && (itr->second._endTime >= currTime || (t && !itr->second.PosChanged(*this, *t)))) return true; return false; } uint32 m_mmapNotAcceptableStartTime; // Safe mover std::set SafeUnitPointerSet; diff --git a/src/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/game/Movement/MovementGenerators/TargetedMovementGenerator.h index 16457149a..19afaa6c3 100644 --- a/src/game/Movement/MovementGenerators/TargetedMovementGenerator.h +++ b/src/game/Movement/MovementGenerators/TargetedMovementGenerator.h @@ -46,14 +46,14 @@ class TargetedMovementGeneratorMedium : public MovementGeneratorMedium< T, D >, protected: void _setTargetLocation(T* owner, bool initial); + PathGenerator* i_path; + uint32 lastPathingFailMSTime; TimeTrackerSmall i_recheckDistance; TimeTrackerSmall i_recheckDistanceForced; float i_offset; float i_angle; bool i_recalculateTravel : 1; bool i_targetReached : 1; - PathGenerator* i_path; - uint32 lastPathingFailMSTime; }; template diff --git a/src/scripts/Commands/cs_spectator.cpp b/src/scripts/Commands/cs_spectator.cpp index 6a846bf0a..82b92f044 100644 --- a/src/scripts/Commands/cs_spectator.cpp +++ b/src/scripts/Commands/cs_spectator.cpp @@ -180,8 +180,8 @@ bool ArenaSpectator::HandleSpectatorSpectateCommand(ChatHandler* handler, char c } bool bgPreparation = false; - if (!handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS || - handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_WAIT_JOIN && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS) + if ((!handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS) || + (handler->GetSession()->GetSecurity() && bgmap->GetBG()->GetStatus() != STATUS_WAIT_JOIN && bgmap->GetBG()->GetStatus() != STATUS_IN_PROGRESS)) { bgPreparation = true; handler->SendSysMessage("Arena is not in progress yet. You will be invited as soon as it starts."); @@ -193,7 +193,7 @@ bool ArenaSpectator::HandleSpectatorSpectateCommand(ChatHandler* handler, char c { handler->PSendSysMessage("To spectate, please fix the following:"); for (std::list::const_iterator itr = errors.begin(); itr != errors.end(); ++itr) - handler->PSendSysMessage(("- "+(*itr)).c_str()); + handler->PSendSysMessage("- %s",(*itr).c_str()); return true; } diff --git a/src/scripts/Spells/spell_generic.cpp b/src/scripts/Spells/spell_generic.cpp index 880c3eeeb..dcc53f02f 100644 --- a/src/scripts/Spells/spell_generic.cpp +++ b/src/scripts/Spells/spell_generic.cpp @@ -2200,7 +2200,7 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader // Spell::SendSpellCooldown() skips all spells with TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD player->AddSpellAndCategoryCooldowns(GetSpellInfo(), GetCastItem() ? GetCastItem()->GetEntry() : 0, GetSpell()); - if (player->GetTeamId(true) == TEAM_HORDE) + if (player->GetTeamId(true) == TEAM_HORDE) { if (GetSpellInfo()->Id == SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER) { WorldPacket data; @@ -2225,6 +2225,7 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader player->GetSession()->SendPacket(&data2); } + } } void Register() diff --git a/src/scripts/Spells/spell_item.cpp b/src/scripts/Spells/spell_item.cpp index 2df661ca3..289d3fe5c 100644 --- a/src/scripts/Spells/spell_item.cpp +++ b/src/scripts/Spells/spell_item.cpp @@ -1053,6 +1053,8 @@ class spell_item_oracle_ablutions : public SpellScriptLoader case POWER_ENERGY: caster->CastSpell(caster, SPELL_ABLUTION_ENERGY, true); break; + default: + break; } if (Player* player = caster->ToPlayer()) { diff --git a/src/scripts/Spells/spell_quest.cpp b/src/scripts/Spells/spell_quest.cpp index ab9df205f..ef4555743 100644 --- a/src/scripts/Spells/spell_quest.cpp +++ b/src/scripts/Spells/spell_quest.cpp @@ -1197,6 +1197,8 @@ class spell_q6124_6129_apply_salve : public SpellScriptLoader if (creatureTarget->GetEntry() == NPC_SICKLY_DEER) newEntry = NPC_CURED_DEER; break; + default: + break; } if (newEntry) { diff --git a/src/scripts/Spells/spell_shaman.cpp b/src/scripts/Spells/spell_shaman.cpp index d51a56575..3a269b381 100644 --- a/src/scripts/Spells/spell_shaman.cpp +++ b/src/scripts/Spells/spell_shaman.cpp @@ -662,7 +662,7 @@ class spell_sha_earth_shield : public SpellScriptLoader AddPct(amount, glyphe->GetAmount()); // xinef: Improved Shields - if (baseAmount = amount - baseAmount) + if ((baseAmount = amount - baseAmount)) if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_SHAMAN, 19, EFFECT_1)) { ApplyPct(baseAmount, aurEff->GetAmount());