Core: Fixes some warnings

Core/SmartAI: Fixed DamageTaken and DamageDealt hooks

--HG--
branch : trunk
extra : rebase_source : 062f1c68cd1d318d192b294a493db17a1943bee2
This commit is contained in:
Shauren
2010-12-14 22:45:23 +01:00
parent 80494d8f64
commit 58a9b15443
13 changed files with 23 additions and 24 deletions
+2 -2
View File
@@ -620,7 +620,7 @@ void SmartAI::SpellHitTarget(Unit* target, const SpellEntry* pSpell)
GetScript()->ProcessEventsFor(SMART_EVENT_SPELLHIT_TARGET, target, 0, 0, false, pSpell);
}
void SmartAI::DamageTaken(Unit* done_by, uint32& damage, DamageEffectType /*damagetype*/)
void SmartAI::DamageTaken(Unit* done_by, uint32& damage)
{
GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED, done_by, damage);
}
@@ -640,7 +640,7 @@ void SmartAI::IsSummonedBy(Unit* summoner)
GetScript()->ProcessEventsFor(SMART_EVENT_JUST_SUMMONED, summoner);
}
void SmartAI::DamageDealt(Unit* done_to, uint32& damage)
void SmartAI::DamageDealt(Unit* done_to, uint32& damage, DamageEffectType /*damagetype*/)
{
GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED_TARGET, done_to, damage);
}
+2 -2
View File
@@ -106,7 +106,7 @@ class SmartAI : public CreatureAI
void SpellHitTarget(Unit* target, const SpellEntry* pSpell);
// Called at any Damage from any attacker (before damage apply)
void DamageTaken(Unit* done_by, uint32& damage, DamageEffectType damagetype);
void DamageTaken(Unit* done_by, uint32& damage);
// Called when the creature receives heal
void HealReceived(Unit* done_by, uint32& addhealth);
@@ -124,7 +124,7 @@ class SmartAI : public CreatureAI
void IsSummonedBy(Unit* summoner);
// Called at any Damage to any victim (before damage apply)
void DamageDealt(Unit * done_to, uint32 & damage);
void DamageDealt(Unit * done_to, uint32 & damage, DamageEffectType /*damagetype*/);
// Called when a summoned creature dissapears (UnSommoned)
void SummonedCreatureDespawn(Creature* unit);
@@ -370,6 +370,7 @@ class BattlegroundEY : public Battleground
bool IsAllNodesConrolledByTeam(uint32 team) const;
private:
void EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType);
void EventPlayerCapturedFlag(Player */*Source*/) {}
void EventTeamCapturedPoint(Player *Source, uint32 Point);
void EventTeamLostPoint(Player *Source, uint32 Point);
void UpdatePointsCount(uint32 Team);
+1 -1
View File
@@ -1775,7 +1775,7 @@ void LFGMgr::TeleportPlayer(Player* plr, bool out, bool fromOpcode /*= false*/)
@param[in] dungeonId Dungeonid (Obsolete)
@param[in] plr Player to reward
*/
void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player)
void LFGMgr::RewardDungeonDoneFor(const uint32 /*dungeonId*/, Player* player)
{
Group* group = player->GetGroup();
if (!group || !group->isLFGGroup())
@@ -101,7 +101,7 @@ void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod& method,
sLFGMgr.OfferContinue(group);
}
void LFGScripts::OnDisband(Group* group)
void LFGScripts::OnDisband(Group* /*group*/)
{
}
@@ -2251,12 +2251,12 @@ void Creature::AllLootRemovedFromCorpse()
}
}
uint8 Creature::getLevelForTarget(Unit const* target) const
uint8 Creature::getLevelForTarget(WorldObject const* target) const
{
if (!isWorldBoss())
if (!isWorldBoss() || !target->ToUnit())
return Unit::getLevelForTarget(target);
uint16 level = target->getLevel() + sWorld.getIntConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF);
uint16 level = target->ToUnit()->getLevel() + sWorld.getIntConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF);
if (level < 1)
return 1;
if (level > 255)
+5 -5
View File
@@ -471,7 +471,7 @@ class Creature : public Unit, public GridObject<Creature>
return GetCreatureInfo()->rank == CREATURE_ELITE_WORLDBOSS;
}
uint8 getLevelForTarget(Unit const* target) const; // overwrite Unit::getLevelForTarget for boss level support
uint8 getLevelForTarget(WorldObject const* target) const; // overwrite Unit::getLevelForTarget for boss level support
bool IsInEvadeMode() const { return hasUnitState(UNIT_STAT_EVADE); }
@@ -530,17 +530,17 @@ class Creature : public Unit, public GridObject<Creature>
void Whisper(int32 textId, uint64 receiver, bool IsBossWhisper = false) { MonsterWhisper(textId,receiver,IsBossWhisper); }
void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); }
// overwrite WorldObject function for proper name localization
// override WorldObject function for proper name localization
const char* GetNameForLocaleIdx(LocaleConstant locale_idx) const;
void setDeathState(DeathState s); // overwrite virtual Unit::setDeathState
void setDeathState(DeathState s); // override virtual Unit::setDeathState
bool FallGround();
bool LoadFromDB(uint32 guid, Map *map);
void SaveToDB();
// overwrited in Pet
// overriden in Pet
virtual void SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask);
virtual void DeleteFromDB(); // overwrited in Pet
virtual void DeleteFromDB(); // overriden in Pet
Loot loot;
bool lootForPickPocketed;
@@ -258,10 +258,6 @@ void TempSummon::RemoveFromWorld()
Creature::RemoveFromWorld();
}
void TempSummon::SaveToDB()
{
}
Minion::Minion(SummonPropertiesEntry const *properties, Unit *owner) : TempSummon(properties, owner)
, m_owner(owner)
{
@@ -25,14 +25,14 @@ class TempSummon : public Creature
{
public:
explicit TempSummon(SummonPropertiesEntry const *properties, Unit *owner);
virtual ~TempSummon(){};
virtual ~TempSummon() {}
void Update(uint32 time);
virtual void InitStats(uint32 lifetime);
virtual void InitSummon();
void UnSummon();
void RemoveFromWorld();
void SetTempSummonType(TempSummonType type);
void SaveToDB();
void SaveToDB(uint32 /*mapid*/, uint8 /*spawnMask*/, uint32 /*phaseMask*/) {}
Unit* GetSummoner() const;
uint64 const& GetSummonerGUID() { return m_summonerGUID; }
+2 -2
View File
@@ -242,11 +242,11 @@ class Pet : public Guardian
DeclinedName *m_declinedname;
private:
void SaveToDB(uint32, uint8) // overwrited of Creature::SaveToDB - don't must be called
void SaveToDB(uint32, uint8, uint32) // override of Creature::SaveToDB - must not be called
{
ASSERT(false);
}
void DeleteFromDB() // overwrited of Creature::DeleteFromDB - don't must be called
void DeleteFromDB() // override of Creature::DeleteFromDB - must not be called
{
ASSERT(false);
}
+1 -1
View File
@@ -286,7 +286,7 @@ int WorldSocket::open (void *a)
return 0;
}
int WorldSocket::close (int)
int WorldSocket::close (u_long)
{
shutdown();
+1 -1
View File
@@ -130,7 +130,7 @@ class WorldSocket : protected WorldHandler
virtual int open (void *);
/// Called on failures inside of the acceptor, don't call from your code.
virtual int close (int);
virtual int close (u_long);
/// Called when we can read from the socket.
virtual int handle_input (ACE_HANDLE = ACE_INVALID_HANDLE);
@@ -2939,6 +2939,8 @@ void AuraEffect::HandlePhase(AuraApplication const * aurApp, uint8 mode, bool ap
for (Unit::AuraEffectList::const_iterator itr = phases.begin(); itr != phases.end(); ++itr)
newPhase |= (*itr)->GetMiscValue();
if (apply)
newPhase |= GetMiscValue();
// phase auras normally not expected at BG but anyway better check
if (Player* player = target->ToPlayer())