Scripts: Fixed uninitialized variables, unreferenced parameters and virtual overrides

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-12-14 16:24:59 +01:00
parent f4581f67b8
commit 314376e32c
18 changed files with 33 additions and 28 deletions

View File

@@ -146,7 +146,7 @@ public:
explicit PacketFilter(WorldSession * pSession) : m_pSession(pSession) {}
virtual ~PacketFilter() {}
virtual bool Process(WorldPacket * packet) { return true; }
virtual bool Process(WorldPacket * /*packet*/) { return true; }
virtual bool ProcessLogout() const { return true; }
protected:

View File

@@ -113,7 +113,7 @@ public:
}
}
uint32 GetData(uint32 uiType, uint32 /*uiData*/)
uint32 GetData(uint32 uiType)
{
switch(uiType)
{

View File

@@ -63,7 +63,7 @@ class boss_netherspite : public CreatureScript
public:
boss_netherspite() : CreatureScript("boss_netherspite") { }
CreatureAI* GetAI(Creature *pCreature)
CreatureAI* GetAI(Creature *pCreature) const
{
return new boss_netherspiteAI(pCreature);
}

View File

@@ -662,7 +662,7 @@ public:
for (uint8 i = 0; i < 4; ++i)
{
float x,y,z;
Unit *pTarget;
Unit *pTarget = NULL;
for (uint8 z = 0; z < 6; ++z)
{
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
@@ -748,7 +748,7 @@ public:
case TIMER_LEGION_LIGHTNING:
if (!me->IsNonMeleeSpellCasted(false))
{
Unit* pRandomPlayer;
Unit* pRandomPlayer = NULL;
me->RemoveAurasDueToSpell(SPELL_SOUL_FLAY);
for (uint8 z = 0; z < 6; ++z)
@@ -844,7 +844,7 @@ public:
TimerIsDeactivated[TIMER_ORBS_EMPOWER] = true;
break;
case TIMER_ARMAGEDDON: //Phase 4
Unit *pTarget;
Unit *pTarget = NULL;
for (uint8 z = 0; z < 6; ++z)
{
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);

View File

@@ -70,7 +70,7 @@ public:
{
}
void KilledUnit()
void KilledUnit(Unit* /*victim*/)
{
// When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70,000 health.
DoCast(me, SPELL_CAPTURESOUL);

View File

@@ -73,7 +73,10 @@ public:
struct instance_dark_portal_InstanceMapScript : public InstanceScript
{
instance_dark_portal_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
instance_dark_portal_InstanceMapScript(Map* pMap) : InstanceScript(pMap)
{
Initialize();
}
uint32 m_auiEncounter[MAX_ENCOUNTER];
@@ -114,7 +117,7 @@ public:
DoUpdateWorldState(WORLD_STATE_BM_RIFT, 0);
}
bool IsEncounterInProgress()
bool IsEncounterInProgress() const
{
if (GetData(TYPE_MEDIVH) == IN_PROGRESS)
return true;

View File

@@ -72,7 +72,7 @@ public:
DoScriptText(SAY_AGGRO, me);
}
void KilledUnit()
void KilledUnit(Unit* /*victim*/)
{
DoScriptText(SAY_KILL, me);
}

View File

@@ -268,7 +268,7 @@ public:
return NULL;
}
Unit* GetAuraEffectTriggerTarget(uint32 spellId, uint8 /*effIndex*/) const
Unit* GetAuraEffectTriggerTarget(uint32 spellId, uint8 /*effIndex*/)
{
switch (spellId)
{

View File

@@ -323,7 +323,7 @@ public:
nWeaver = 0;
}
void KilledUnit()
void KilledUnit(Unit* /*victim*/)
{
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}

View File

@@ -788,7 +788,7 @@ public:
{
}
void JustDied()
void JustDied(Unit* /*killer*/)
{
float x,y,z;
me->GetPosition(x,y,z);

View File

@@ -436,7 +436,7 @@ public:
void SpawnTrigger()
{
uint8 iStart,iEnd;
uint8 iStart = 0, iEnd = 0;
switch (urand(0,1))
{
case 0:
@@ -447,9 +447,11 @@ public:
iStart = 38;
iEnd = 68;
break;
default:
break;
}
for(uint32 i = iStart; i < iEnd; ++i)
me->SummonCreature(CREATURE_TRIGGER,Location[i]);
for (uint32 i = iStart; i < iEnd; ++i)
me->SummonCreature(CREATURE_TRIGGER, Location[i]);
}
};

View File

@@ -232,7 +232,7 @@ public:
}
// called by svala sorrowgrave to set guid of victim
void DoAction(uint32 /*action*/)
void DoAction(const int32 /*action*/)
{
if (pInstance)
if (Unit *pVictim = me->GetUnit(*me, pInstance->GetData64(DATA_SACRIFICED_PLAYER)))

View File

@@ -2418,11 +2418,11 @@ public:
me->RestoreFaction();
}
void DoAction(const int32 iParam)
void DoAction(const int32 /*iParam*/)
{
me->StopMoving();
me->SetUInt32Value(UNIT_NPC_FLAGS,0);
if (Player* pPlayer = me->GetPlayer(*me,uiPlayerGUID))
me->SetUInt32Value(UNIT_NPC_FLAGS, 0);
if (Player* pPlayer = me->GetPlayer(*me, uiPlayerGUID))
{
me->SetInFront(pPlayer);
me->SendMovementFlagUpdate();
@@ -2431,7 +2431,7 @@ public:
uiEventPhase = 1;
}
void SetGUID(const uint64 &uiGuid, int32 iId)
void SetGUID(const uint64 &uiGuid, int32 /*iId*/)
{
uiPlayerGUID = uiGuid;
}
@@ -2546,7 +2546,7 @@ public:
return true;
}
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
pPlayer->PlayerTalkClass->ClearMenus();

View File

@@ -419,12 +419,12 @@ public:
me->SummonCreature(uiEntry, afSummon[0], afSummon[1], afSummon[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30*IN_MILLISECONDS);
}
void SummonedCreatureDies(Creature* pSummoned, Unit* pKiller)
void SummonedCreatureDies(Creature* pSummoned, Unit* /*pKiller*/)
{
uint32 uiEntry = 0;
// will eventually reset the event if something goes wrong
switch(pSummoned->GetEntry())
switch (pSummoned->GetEntry())
{
case NPC_FIRJUS: uiEntry = NPC_JLARBORN; break;
case NPC_JLARBORN: uiEntry = NPC_YOROS; break;

View File

@@ -279,7 +279,7 @@ public:
void MoveInLineOfSight(Unit * /*who*/) {}
void DoAction(const uint32 /*info*/)
void DoAction(const int32 /*info*/)
{
me->RemoveAura(SPELL_VOLCANIC_ERUPTION);
}

View File

@@ -104,7 +104,7 @@ public:
pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS);
}
void KilledUnit()
void KilledUnit(Unit* /*victim*/)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}

View File

@@ -168,7 +168,7 @@ public:
pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED);
}
void KilledUnit()
void KilledUnit(Unit* /*victim*/)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}

View File

@@ -430,7 +430,7 @@ class boss_kaelthas : public CreatureScript
StartEvent();
}
void KilledUnit()
void KilledUnit(Unit* /*victim*/)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}