aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElron103 <scarymovie87@gmx.de>2012-06-20 21:29:41 +0200
committerElron103 <scarymovie87@gmx.de>2012-06-20 21:29:41 +0200
commitf3aacb669ca1ad3147bdcc1c541ebf3a7e2d7343 (patch)
treec1f75500b1379e105cde632df8a28d0c94a92180
parent35b444fdb8e1be43c261b23bbeb8a94cefada93a (diff)
Scripts/Miscellaneous: Enable const-ness for various functions in ScriptedAI (Author: DorianGrey)
- Improve codestyle, since objects internal state is not changed here - Make these functions available for inherited CanAIAttack() function
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
index 4fac8b3cba5..ba0a94d2590 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
@@ -191,7 +191,7 @@ struct ScriptedAI : public CreatureAI
//Generally used to control if MoveChase() is to be used or not in AttackStart(). Some creatures does not chase victims
void SetCombatMovement(bool allowMovement);
- bool IsCombatMovementAllowed() { return _isCombatMovementAllowed; }
+ bool IsCombatMovementAllowed() const { return _isCombatMovementAllowed; }
bool EnterEvadeIfOutOfCombatArea(uint32 const diff);
@@ -200,16 +200,16 @@ struct ScriptedAI : public CreatureAI
// - for raid in mode 10-Heroic
// - for raid in mode 25-heroic
// DO NOT USE to check raid in mode 25-normal.
- bool IsHeroic() { return _isHeroic; }
+ bool IsHeroic() const { return _isHeroic; }
// return the dungeon or raid difficulty
- Difficulty GetDifficulty() { return _difficulty; }
+ Difficulty GetDifficulty() const { return _difficulty; }
// return true for 25 man or 25 man heroic mode
- bool Is25ManRaid() { return _difficulty & RAID_DIFFICULTY_MASK_25MAN; }
+ bool Is25ManRaid() const { return _difficulty & RAID_DIFFICULTY_MASK_25MAN; }
template<class T> inline
- const T& DUNGEON_MODE(const T& normal5, const T& heroic10)
+ const T& DUNGEON_MODE(const T& normal5, const T& heroic10) const
{
switch (_difficulty)
{
@@ -225,7 +225,7 @@ struct ScriptedAI : public CreatureAI
}
template<class T> inline
- const T& RAID_MODE(const T& normal10, const T& normal25)
+ const T& RAID_MODE(const T& normal10, const T& normal25) const
{
switch (_difficulty)
{
@@ -241,7 +241,7 @@ struct ScriptedAI : public CreatureAI
}
template<class T> inline
- const T& RAID_MODE(const T& normal10, const T& normal25, const T& heroic10, const T& heroic25)
+ const T& RAID_MODE(const T& normal10, const T& normal25, const T& heroic10, const T& heroic25) const
{
switch (_difficulty)
{