From 00eef91aa2acd95719a18c6c6b1bb03d8b4919fe Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Thu, 13 Apr 2017 00:51:17 +0300 Subject: [PATCH] Fix clang warnings about variable usage --- GameObjectMethods.h | 4 ++-- LuaFunctions.cpp | 1 - MapMethods.h | 2 +- PlayerMethods.h | 19 ------------------- ServerHooks.cpp | 2 +- UnitMethods.h | 4 ++-- WorldObjectMethods.h | 2 +- 7 files changed, 7 insertions(+), 27 deletions(-) diff --git a/GameObjectMethods.h b/GameObjectMethods.h index 939a78d..38d0845 100644 --- a/GameObjectMethods.h +++ b/GameObjectMethods.h @@ -289,7 +289,7 @@ namespace LuaGameObject * * The gameobject may be automatically respawned by the core */ - int Despawn(lua_State* L, GameObject* go) + int Despawn(lua_State* /*L*/, GameObject* go) { go->SetLootState(GO_JUST_DEACTIVATED); return 0; @@ -298,7 +298,7 @@ namespace LuaGameObject /** * Respawns a [GameObject] */ - int Respawn(lua_State* L, GameObject* go) + int Respawn(lua_State* /*L*/, GameObject* go) { go->Respawn(); return 0; diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index e8cbb66..73f316d 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -639,7 +639,6 @@ ElunaRegister PlayerMethods[] = { "GossipClearMenu", &LuaPlayer::GossipClearMenu }, // Other - { "SendClearCooldowns", &LuaPlayer::SendClearCooldowns }, { "SendBroadcastMessage", &LuaPlayer::SendBroadcastMessage }, { "SendAreaTriggerMessage", &LuaPlayer::SendAreaTriggerMessage }, { "SendNotification", &LuaPlayer::SendNotification }, diff --git a/MapMethods.h b/MapMethods.h index 1894f9f..8573a76 100644 --- a/MapMethods.h +++ b/MapMethods.h @@ -305,7 +305,7 @@ namespace LuaMap /** * Saves the [Map]'s instance data to the database. */ - int SaveInstanceData(lua_State* L, Map* map) + int SaveInstanceData(lua_State* /*L*/, Map* map) { #ifdef TRINITY ElunaInstanceAI* iAI = NULL; diff --git a/PlayerMethods.h b/PlayerMethods.h index cd1866f..ef1bcbb 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -3432,25 +3432,6 @@ namespace LuaPlayer return 0; } - /** - * Clears a cooldown of the specified spell - * - * @param uint32 spellId : entry of a spell - * @param [Unit] target - */ - int SendClearCooldowns(lua_State* L, Player* player) - { - uint32 spellId = Eluna::CHECKVAL(L, 2); - Unit* target = Eluna::CHECKOBJ(L, 3); - -#ifdef TRINITY - target->GetSpellHistory()->ResetCooldown(spellId, true); -#else - player->SendClearCooldown(spellId, target); -#endif - return 0; - } - /** * Sends a Broadcast Message to the [Player] * diff --git a/ServerHooks.cpp b/ServerHooks.cpp index 65a2c27..5f99c58 100644 --- a/ServerHooks.cpp +++ b/ServerHooks.cpp @@ -107,7 +107,7 @@ bool Eluna::OnAreaTrigger(Player* pPlayer, AreaTriggerEntry const* pTrigger) } // Weather -void Eluna::OnChange(Weather* weather, uint32 zone, WeatherState state, float grade) +void Eluna::OnChange(Weather* /*weather*/, uint32 zone, WeatherState state, float grade) { START_HOOK(WEATHER_EVENT_ON_CHANGE); Push(zone); diff --git a/UnitMethods.h b/UnitMethods.h index 34365c3..21deeac 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -2285,7 +2285,7 @@ namespace LuaUnit */ int CastSpell(lua_State* L, Unit* unit) { - Unit* target = Eluna::CHECKOBJ(L, 2, NULL); + Unit* target = Eluna::CHECKOBJ(L, 2, false); uint32 spell = Eluna::CHECKVAL(L, 3); bool triggered = Eluna::CHECKVAL(L, 4, false); #ifdef CMANGOS @@ -2319,7 +2319,7 @@ namespace LuaUnit */ int CastCustomSpell(lua_State* L, Unit* unit) { - Unit* target = Eluna::CHECKOBJ(L, 2, NULL); + Unit* target = Eluna::CHECKOBJ(L, 2, false); uint32 spell = Eluna::CHECKVAL(L, 3); bool triggered = Eluna::CHECKVAL(L, 4, false); bool has_bp0 = !lua_isnoneornil(L, 5); diff --git a/WorldObjectMethods.h b/WorldObjectMethods.h index e2faa25..5775765 100644 --- a/WorldObjectMethods.h +++ b/WorldObjectMethods.h @@ -396,7 +396,7 @@ namespace LuaWorldObject float x, y, z; obj->GetPosition(x, y, z); - ElunaUtil::WorldObjectInRangeCheck checker(true, obj, range, type, entry, hostile); + ElunaUtil::WorldObjectInRangeCheck checker(true, obj, range, type, entry, hostile, dead); WorldObject* target = NULL; #ifndef TRINITY