Core: Warning fixes

This commit is contained in:
Shauren
2011-05-07 19:08:50 +02:00
parent b82ae5ad0d
commit 7905200eba
16 changed files with 44 additions and 28 deletions
@@ -85,7 +85,7 @@ void BattlegroundIC::SendTransportInit(Player* player)
player->GetSession()->SendPacket(&packet);
}
void BattlegroundIC::DoAction(uint32 action, uint64 var)
void BattlegroundIC::DoAction(uint32 action, uint64 const& var)
{
if (action != ACTION_TELEPORT_PLAYER_TO_TRANSPORT)
return;
@@ -888,7 +888,7 @@ class BattlegroundIC : public Battleground
void FillInitialWorldStates(WorldPacket& data);
virtual void DoAction(uint32 action, uint64 var);
void DoAction(uint32 action, uint64 const& var);
virtual void HandlePlayerResurrect(Player* player);
+1 -1
View File
@@ -49,7 +49,7 @@ class ChatHandler
WorldSession * GetSession() { return m_session; }
explicit ChatHandler(WorldSession* session) : m_session(session) {}
explicit ChatHandler(Player* player) : m_session(player->GetSession()) {}
~ChatHandler() {}
virtual ~ChatHandler() {}
static void FillMessageData(WorldPacket *data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit *speaker);
+1
View File
@@ -37,6 +37,7 @@ class ChatLink
{
public:
ChatLink() : _color(0), _startPos(0), _endPos(0) { }
virtual ~ChatLink() { }
void SetColor(uint32 color) { _color = color; }
// This will allow to extract the whole link string from the message, if necessary.
void SetBounds(std::istringstream::pos_type startPos, std::istringstream::pos_type endPos) { _startPos = startPos; _endPos = endPos; }
+3 -1
View File
@@ -93,6 +93,8 @@ class OPvPCapturePoint
OPvPCapturePoint(OutdoorPvP * pvp);
virtual ~OPvPCapturePoint() {}
virtual void FillInitialWorldStates(WorldPacket & /*data*/) {}
// send world state update to all players present
@@ -196,7 +198,7 @@ class OutdoorPvP : public ZoneScript
OutdoorPvP();
// dtor
~OutdoorPvP();
virtual ~OutdoorPvP();
// deletes all gos/creatures spawned by the pvp
void DeleteSpawns();
+1 -1
View File
@@ -238,7 +238,7 @@ class ServerScript : public ScriptObject
virtual void OnUnknownPacketReceive(WorldSocket* /*socket*/, WorldPacket& /*packet*/) { }
};
class WorldScript : public ScriptObject, public UpdatableScript<void>
class WorldScript : public ScriptObject
{
protected:
+7 -5
View File
@@ -21,16 +21,18 @@
#include "ObjectMgr.h"
#include "DatabaseEnv.h"
ScriptPointVector const SystemMgr::_empty;
void SystemMgr::LoadVersion()
{
//Get Version information
QueryResult Result = WorldDatabase.Query("SELECT script_version FROM version LIMIT 1");
// Get Version information
QueryResult result = WorldDatabase.Query("SELECT script_version FROM version LIMIT 1");
if (Result)
if (result)
{
Field* pFields = Result->Fetch();
Field* fields = result->Fetch();
sLog->outString("TSCR: Database version is: %s", pFields[0].GetCString());
sLog->outString("TSCR: Database version is: %s", fields[0].GetCString());
sLog->outString();
}
else
+4 -4
View File
@@ -82,20 +82,20 @@ class SystemMgr
ScriptPointVector const& GetPointMoveList(uint32 creatureEntry) const
{
static ScriptPointVector empty;
PointMoveMap::const_iterator itr = m_mPointMoveMap.find(creatureEntry);
if (itr == m_mPointMoveMap.end())
return empty;
return _empty;
return itr->second;
}
protected:
TextDataMap m_mTextDataMap; //additional data for text strings
PointMoveMap m_mPointMoveMap; //coordinates for waypoints
private:
static ScriptPointVector const _empty;
};
#define sScriptSystemMgr ACE_Singleton<SystemMgr, ACE_Null_Mutex>::instance()
+1 -1
View File
@@ -86,7 +86,7 @@ class Aura
static Aura * Create(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount = NULL, Item * castItem = NULL, uint64 casterGUID = 0);
explicit Aura(SpellEntry const* spellproto, WorldObject * owner, Unit * caster, Item * castItem, uint64 casterGUID);
void _InitEffects(uint8 effMask, Unit * caster, int32 *baseAmount);
~Aura();
virtual ~Aura();
SpellEntry const* GetSpellProto() const { return m_spellProto; }
uint32 GetId() const{ return GetSpellProto()->Id; }
@@ -531,7 +531,7 @@ public:
};
#define ESSENCE_REMOVE 0
#define ESSENCE_REMOVE 0
#define ESSENCE_APPLY 1
class mob_essence_of_twin : public CreatureScript
@@ -545,14 +545,19 @@ class mob_essence_of_twin : public CreatureScript
uint32 GetData(uint32 data)
{
uint32 spellReturned;
uint32 spellReturned = 0;
switch (me->GetEntry())
{
case NPC_LIGHT_ESSENCE:
spellReturned = data == ESSENCE_REMOVE? SPELL_DARK_ESSENCE_HELPER : SPELL_LIGHT_ESSENCE_HELPER;
break;
case NPC_DARK_ESSENCE:
spellReturned = data == ESSENCE_REMOVE? SPELL_LIGHT_ESSENCE_HELPER : SPELL_DARK_ESSENCE_HELPER;
break;
default:
break;
}
return spellReturned;
}
};
@@ -1178,7 +1178,7 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader
{
// select one random target, with preference of ranged targets
uint32 targetsAtRange = 0;
uint32 const minTargets = GetCaster()->GetMap()->GetSpawnMode() & 1 ? 10 : 4;
uint32 const minTargets = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 10 : 4);
unitList.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), false));
// get target count at range
@@ -386,7 +386,7 @@ class spell_festergut_gastric_bloat : public SpellScriptLoader
{
PrepareSpellScript(spell_festergut_gastric_bloat_SpellScript);
bool Validate(SpellEntry const* spell)
bool Validate(SpellEntry const* /*spell*/)
{
if (!sSpellStore.LookupEntry(SPELL_GASTRIC_EXPLOSION))
return false;
@@ -499,7 +499,7 @@ class boss_professor_putricide : public CreatureScript
return _phase;
case DATA_ABOMINATION:
summons.RemoveNotExisting();
return summons.HasEntry(NPC_MUTATED_ABOMINATION_10) || summons.HasEntry(NPC_MUTATED_ABOMINATION_25);
return uint32(summons.HasEntry(NPC_MUTATED_ABOMINATION_10) || summons.HasEntry(NPC_MUTATED_ABOMINATION_25));
default:
break;
}
@@ -30,7 +30,7 @@ public:
struct instance_eye_of_eternity_InstanceMapScript : public InstanceScript
{
instance_eye_of_eternity_InstanceMapScript(Map* map) : InstanceScript(map)
instance_eye_of_eternity_InstanceMapScript(Map* map) : InstanceScript(map)
{
SetBossNumber(MAX_ENCOUNTER);
@@ -67,7 +67,8 @@ public:
if (GameObject* platform = instance->GetGameObject(platformGUID))
platform->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
} else if (state == DONE)
}
else if (state == DONE)
{
if (Creature* malygos = instance->GetCreature(malygosGUID))
malygos->SummonCreature(NPC_ALEXSTRASZA, 829.0679f, 1244.77f, 279.7453f, 2.32f);
@@ -79,7 +80,7 @@ public:
platform->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
if (GameObject* chest = instance->GetGameObject(chestGUID))
chest->SetRespawnTime(chest->GetRespawnDelay());
chest->SetRespawnTime(7*DAY);
}
}
return true;
@@ -150,6 +151,11 @@ public:
}
}
// eliminate compile warning
void ProcessEvent(Unit* /*unit*/, uint32 /*eventId*/)
{
}
void VortexHandling()
{
if (Creature* malygos = instance->GetCreature(malygosGUID))
@@ -309,7 +309,7 @@ class boss_flame_leviathan : public CreatureScript
}
// TODO: effect 0 and effect 1 may be on different target
void SpellHitTarget(Unit* target, SpellEntry* const spell)
void SpellHitTarget(Unit* target, SpellEntry const* spell)
{
if (spell->Id == SPELL_PURSUED)
AttackStart(target);
@@ -336,7 +336,7 @@ class boss_flame_leviathan : public CreatureScript
}
}
void SpellHit(Unit* /*caster*/, SpellEntry* const spell)
void SpellHit(Unit* /*caster*/, SpellEntry const* spell)
{
if (spell->Id == SPELL_START_THE_ENGINE)
vehicle->InstallAllAccessories(false);
@@ -671,7 +671,7 @@ class boss_flame_leviathan_defense_cannon : public CreatureScript
NapalmTimer -= diff;
}
bool CanAIAttack(Unit* const who) const
bool CanAIAttack(Unit const* who) const
{
if (who->GetTypeId() != TYPEID_PLAYER || !who->GetVehicle() || who->GetVehicleBase()->GetEntry() == NPC_SEAT)
return false;
@@ -700,7 +700,7 @@ class boss_flame_leviathan_defense_turret : public CreatureScript
damage = 0;
}
bool CanAIAttack(Unit* const who) const
bool CanAIAttack(Unit const* who) const
{
if (who->GetTypeId() != TYPEID_PLAYER || !who->GetVehicle() || who->GetVehicleBase()->GetEntry() != NPC_SEAT)
return false;
+1 -1
View File
@@ -80,7 +80,7 @@ class MySQLConnection
public:
MySQLConnection(MySQLConnectionInfo& connInfo); //! Constructor for synchronous connections.
MySQLConnection(ACE_Activation_Queue* queue, MySQLConnectionInfo& connInfo); //! Constructor for asynchronous connections.
~MySQLConnection();
virtual ~MySQLConnection();
virtual bool Open();
void Close();