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
@@ -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; }