From 333b8e5159ada2f1b8cbfd1dd8eb9072754477d7 Mon Sep 17 00:00:00 2001 From: Spp Date: Fri, 9 Nov 2012 13:13:45 +0100 Subject: Core/Build: Enable Clang PCH support and OS X specific features Core: Fix warnings here and there --- src/server/scripts/CMakeLists.txt | 28 ++++++++-------------- src/server/scripts/Commands/cs_wp.cpp | 2 +- .../ChamberOfAspects/RubySanctum/boss_halion.cpp | 4 ++-- src/server/scripts/Northrend/wintergrasp.cpp | 2 +- 4 files changed, 14 insertions(+), 22 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt index 59dfc0f990f..8e636ee1208 100644 --- a/src/server/scripts/CMakeLists.txt +++ b/src/server/scripts/CMakeLists.txt @@ -9,18 +9,11 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # Enable precompiled headers when using the GCC compiler. -if( USE_SCRIPTPCH ) - include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ) -endif() -if( USE_SCRIPTPCH AND MSVC ) - set(scripts_STAT_SRCS - PrecompiledHeaders/ScriptPCH.cpp - PrecompiledHeaders/ScriptPCH.h - ) -endif() +if (USE_SCRIPTPCH) + set(scripts_STAT_PCH_HDR PrecompiledHeaders/ScriptPCH.h) + set(scripts_STAT_PCH_SRC PrecompiledHeaders/ScriptPCH.cpp) +endif () message(STATUS "SCRIPT PREPARATIONS") include(Spells/CMakeLists.txt) @@ -148,15 +141,14 @@ include_directories( ${MYSQL_INCLUDE_DIR} ) -add_library(scripts STATIC ${scripts_STAT_SRCS}) +add_library(scripts STATIC + ${scripts_STAT_SRCS} + ${scripts_STAT_PCH_SRC} +) add_dependencies(scripts revision.h) # Generate precompiled header -if( USE_SCRIPTPCH ) - if(CMAKE_COMPILER_IS_GNUCXX) - add_precompiled_header(scripts ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/ScriptPCH.h) - elseif(MSVC) - add_native_precompiled_header(scripts ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/ScriptPCH) - endif() +if (USE_SCRIPTPCH) + add_cxx_pch(scripts ${scripts_STAT_PCH_HDR} ${scripts_STAT_PCH_SRC}) endif() diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index e3cd185e4a3..10a18c3ed36 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -941,7 +941,7 @@ public: { wpCreature->SetDisplayId(target->GetDisplayId()); wpCreature->SetObjectScale(0.5f); - wpCreature->SetLevel(point > STRONG_MAX_LEVEL ? STRONG_MAX_LEVEL : point); + wpCreature->SetLevel(std::min(point, STRONG_MAX_LEVEL)); } } while (result->NextRow()); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index 82739c0026a..1d0b0fd6ee6 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -1375,7 +1375,7 @@ class spell_halion_combustion_consumption : public SpellScriptLoader public: spell_halion_combustion_consumption_AuraScript(uint32 spellID) : AuraScript(), _markSpell(spellID) { } - bool Validate(SpellEntry const* /*spell*/) + bool Validate(SpellInfo const* /*spell*/) { if (!sSpellMgr->GetSpellInfo(_markSpell)) return false; @@ -1434,7 +1434,7 @@ class spell_halion_marks : public SpellScriptLoader spell_halion_marks_AuraScript(uint32 summonSpell, uint32 removeSpell) : AuraScript(), _summonSpellId(summonSpell), _removeSpellId(removeSpell) { } - bool Validate(SpellEntry const* /*spell*/) + bool Validate(SpellInfo const* /*spell*/) { if (!sSpellMgr->GetSpellInfo(_summonSpellId)) return false; diff --git a/src/server/scripts/Northrend/wintergrasp.cpp b/src/server/scripts/Northrend/wintergrasp.cpp index d4a3f83ab70..b7901f1a44a 100644 --- a/src/server/scripts/Northrend/wintergrasp.cpp +++ b/src/server/scripts/Northrend/wintergrasp.cpp @@ -560,7 +560,7 @@ public: if (Battlefield* wg = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG)) if (Player* target = GetExplTargetUnit()->ToPlayer()) // check if we are in Wintergrasp at all, SotA uses same teleport spells - if ((target->GetZoneId() == 4197) && target->GetTeamId() != wg->GetDefenderTeam() || target->HasAura(SPELL_WINTERGRASP_TELEPORT_TRIGGER)) + if ((target->GetZoneId() == 4197 && target->GetTeamId() != wg->GetDefenderTeam()) || target->HasAura(SPELL_WINTERGRASP_TELEPORT_TRIGGER)) return SPELL_FAILED_BAD_TARGETS; return SPELL_CAST_OK; } -- cgit v1.2.3