From 620887fe610650358949454ef52d753e71a83703 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sun, 20 Aug 2017 12:34:06 +0200 Subject: [PATCH] fixed compilation with ENABLE_* defines disabled --- src/authserver/Server/AuthSocket.cpp | 12 ------------ src/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 4 ---- src/game/Entities/Unit/Unit.cpp | 12 ++++++++---- src/game/Handlers/MiscHandler.cpp | 3 ++- src/game/Instances/InstanceScript.cpp | 6 ++++-- src/game/Maps/MapManager.cpp | 3 ++- .../WaypointMovementGenerator.cpp | 3 ++- src/game/Spells/Auras/SpellAuraEffects.cpp | 15 +++++++++------ src/game/Spells/Auras/SpellAuras.cpp | 3 ++- 9 files changed, 29 insertions(+), 32 deletions(-) diff --git a/src/authserver/Server/AuthSocket.cpp b/src/authserver/Server/AuthSocket.cpp index 0df9deb6c..9f09e7fe2 100644 --- a/src/authserver/Server/AuthSocket.cpp +++ b/src/authserver/Server/AuthSocket.cpp @@ -421,29 +421,21 @@ bool AuthSocket::_HandleLogonChallenge() bool locked = false; if (fields[2].GetUInt8() == 1) // if ip is locked { -#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[3].GetCString()); sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Player address is '%s'", ip_address.c_str()); -#endif if (strcmp(fields[4].GetCString(), ip_address.c_str()) != 0) { -#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account IP differs"); -#endif pkt << uint8(WOW_FAIL_LOCKED_ENFORCED); locked = true; } else -#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account IP matches"); -#endif } else { -#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account '%s' is not locked to ip", _login.c_str()); -#endif std::string accountCountry = fields[3].GetString(); if (accountCountry.empty() || accountCountry == "00") sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account '%s' is not locked to country", _login.c_str()); @@ -486,16 +478,12 @@ bool AuthSocket::_HandleLogonChallenge() if ((*banresult)[0].GetUInt32() == (*banresult)[1].GetUInt32()) { pkt << uint8(WOW_FAIL_BANNED); -#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] Banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); -#endif } else { pkt << uint8(WOW_FAIL_SUSPENDED); -#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); -#endif } } else diff --git a/src/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/game/AI/ScriptedAI/ScriptedEscortAI.cpp index fd2de7217..9e0b88d15 100644 --- a/src/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -386,18 +386,14 @@ void npc_escortAI::SetRun(bool on) if (!m_bIsRunning) me->SetWalk(false); else -#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set run mode, but is already running."); -#endif } else { if (m_bIsRunning) me->SetWalk(true); else -#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set walk mode, but is already walking."); -#endif } m_bIsRunning = on; diff --git a/src/game/Entities/Unit/Unit.cpp b/src/game/Entities/Unit/Unit.cpp index 06c5e75c9..43a0ffbe7 100644 --- a/src/game/Entities/Unit/Unit.cpp +++ b/src/game/Entities/Unit/Unit.cpp @@ -2285,10 +2285,12 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy // parry & block chances // check if attack comes from behind, nobody can parry or block if attacker is behind - if (!victim->HasInArc(M_PI, this) && !victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) + if (!victim->HasInArc(M_PI, this) && !victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) + { #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) - sLog->outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind."); + sLog->outStaticDebug("RollMeleeOutcomeAgainst: attack came from behind."); #endif + } else { // Reduce parry chance by attacker expertise rating @@ -2393,10 +2395,12 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum); #endif - if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT)) + if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT)) + { #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) - sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT DISABLED)"); + sLog->outStaticDebug("RollMeleeOutcomeAgainst: CRIT DISABLED)"); #endif + } else return MELEE_HIT_CRIT; } diff --git a/src/game/Handlers/MiscHandler.cpp b/src/game/Handlers/MiscHandler.cpp index 1c7c30546..f69def813 100644 --- a/src/game/Handlers/MiscHandler.cpp +++ b/src/game/Handlers/MiscHandler.cpp @@ -1473,10 +1473,11 @@ void WorldSession::HandleFarSightOpcode(WorldPacket& recvData) #endif if (WorldObject* target = _player->GetViewpoint()) _player->SetSeer(target); - else + else { #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outError("Player %s requests non-existing seer " UI64FMTD, _player->GetName().c_str(), _player->GetUInt64Value(PLAYER_FARSIGHT)); #endif + } } else { diff --git a/src/game/Instances/InstanceScript.cpp b/src/game/Instances/InstanceScript.cpp index e2e5e49d5..05ebf650d 100644 --- a/src/game/Instances/InstanceScript.cpp +++ b/src/game/Instances/InstanceScript.cpp @@ -42,10 +42,11 @@ void InstanceScript::HandleGameObject(uint64 GUID, bool open, GameObject* go) go = instance->GetGameObject(GUID); if (go) go->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); - else + else { #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: InstanceScript: HandleGameObject failed"); #endif + } } bool InstanceScript::IsEncounterInProgress() const @@ -300,10 +301,11 @@ void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData) if (Player* player = itr->GetSource()) player->SendUpdateWorldState(uiStateId, uiStateData); } - else + else { #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: DoUpdateWorldState attempt send data but no players in map."); #endif + } } // Send Notify to all players in instance diff --git a/src/game/Maps/MapManager.cpp b/src/game/Maps/MapManager.cpp index f36fd2403..c865f7356 100644 --- a/src/game/Maps/MapManager.cpp +++ b/src/game/Maps/MapManager.cpp @@ -197,10 +197,11 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) player->ResurrectPlayer(0.5f, false); player->SpawnCorpseBones(); } - else + else { #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "Map::CanPlayerEnter - player '%s' is dead but does not have a corpse!", player->GetName().c_str()); #endif + } } // if map exists - check for being full, etc. diff --git a/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index a3fcfb64d..0b5aaf71c 100644 --- a/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -484,8 +484,9 @@ void FlightPathMovementGenerator::PreloadEndGrid() #endif endMap->LoadGrid(_endGridX, _endGridY); } - else + else { #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Unable to determine map to preload flightmaster grid"); #endif + } } diff --git a/src/game/Spells/Auras/SpellAuraEffects.cpp b/src/game/Spells/Auras/SpellAuraEffects.cpp index 2ca4559db..f3cbe6d6e 100644 --- a/src/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/game/Spells/Auras/SpellAuraEffects.cpp @@ -6022,10 +6022,11 @@ void AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* #endif } } - else + else { #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) - sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex()); #endif + } } void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const @@ -6636,10 +6637,11 @@ void AuraEffect::HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEve #endif triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo, true, NULL, this); } - else + else { #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) - sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"AuraEffect::HandleProcTriggerSpellAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleProcTriggerSpellAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); #endif + } } void AuraEffect::HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) @@ -6656,10 +6658,11 @@ void AuraEffect::HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp #endif triggerCaster->CastCustomSpell(triggerTarget, triggerSpellId, &basepoints0, NULL, NULL, true, NULL, this); } - else + else { #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) - sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); #endif + } } void AuraEffect::HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) diff --git a/src/game/Spells/Auras/SpellAuras.cpp b/src/game/Spells/Auras/SpellAuras.cpp index d63ea0451..b2a0a7e71 100644 --- a/src/game/Spells/Auras/SpellAuras.cpp +++ b/src/game/Spells/Auras/SpellAuras.cpp @@ -66,10 +66,11 @@ _flags(AFLAG_NONE), _effectsToApply(effMask), _needClientUpdate(false), _disable sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura: %u Effect: %d put to unit visible auras slot: %u", GetBase()->GetId(), GetEffectMask(), slot); #endif } - else + else { #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura: %u Effect: %d could not find empty unit visible slot", GetBase()->GetId(), GetEffectMask()); #endif + } } _InitFlags(caster, effMask);