diff options
| author | Shauren <none@none> | 2010-12-17 13:43:24 +0100 |
|---|---|---|
| committer | Shauren <none@none> | 2010-12-17 13:43:24 +0100 |
| commit | 82f45966fc00106b52294e4c01a2848ba24e2eb8 (patch) | |
| tree | dd3ee1457f54da1cdeebe3ded7e6e29f282d2bc9 /src/server/game/AI | |
| parent | ee3fd3ebebcbf85d3ff942eb462b15368b76e8c1 (diff) | |
Core/Unit: Renamed addUnitState/hasUnitState/clearUnitState to AddUnitState/HasUnitState/ClearUnitState
Core/Vehicles: Allow the vehicle to always damage the passenger (removed unneded dbc hacks from scripts)
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/AI')
| -rwxr-xr-x | src/server/game/AI/CoreAI/CombatAI.cpp | 4 | ||||
| -rwxr-xr-x | src/server/game/AI/CoreAI/PassiveAI.cpp | 4 | ||||
| -rwxr-xr-x | src/server/game/AI/CoreAI/PetAI.cpp | 6 | ||||
| -rwxr-xr-x | src/server/game/AI/CoreAI/UnitAI.cpp | 4 | ||||
| -rwxr-xr-x | src/server/game/AI/CreatureAIImpl.h | 4 | ||||
| -rwxr-xr-x | src/server/game/AI/EventAI/CreatureEventAI.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 14 |
8 files changed, 21 insertions, 21 deletions
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp index f54daa9367f..a36aa000b01 100755 --- a/src/server/game/AI/CoreAI/CombatAI.cpp +++ b/src/server/game/AI/CoreAI/CombatAI.cpp @@ -102,7 +102,7 @@ void CombatAI::UpdateAI(const uint32 diff) events.Update(diff); - if (me->hasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STAT_CASTING)) return; if (uint32 spellId = events.ExecuteEvent()) @@ -161,7 +161,7 @@ void CasterAI::UpdateAI(const uint32 diff) events.Update(diff); - if (me->hasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STAT_CASTING)) return; if (uint32 spellId = events.ExecuteEvent()) diff --git a/src/server/game/AI/CoreAI/PassiveAI.cpp b/src/server/game/AI/CoreAI/PassiveAI.cpp index 59f6e2e0a75..dff7666d1c6 100755 --- a/src/server/game/AI/CoreAI/PassiveAI.cpp +++ b/src/server/game/AI/CoreAI/PassiveAI.cpp @@ -61,13 +61,13 @@ void PossessedAI::KilledUnit(Unit* victim) void CritterAI::DamageTaken(Unit * /*done_by*/, uint32 &) { - if (!me->hasUnitState(UNIT_STAT_FLEEING)) + if (!me->HasUnitState(UNIT_STAT_FLEEING)) me->SetControlled(true, UNIT_STAT_FLEEING); } void CritterAI::EnterEvadeMode() { - if (me->hasUnitState(UNIT_STAT_FLEEING)) + if (me->HasUnitState(UNIT_STAT_FLEEING)) me->SetControlled(false, UNIT_STAT_FLEEING); CreatureAI::EnterEvadeMode(); } diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 31262d8eedd..c624773e90b 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -115,14 +115,14 @@ void PetAI::UpdateAI(const uint32 diff) else HandleReturnMovement(); } - else if (owner && !me->hasUnitState(UNIT_STAT_FOLLOW)) // no charm info and no victim + else if (owner && !me->HasUnitState(UNIT_STAT_FOLLOW)) // no charm info and no victim me->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST, me->GetFollowAngle()); if (!me->GetCharmInfo()) return; // Autocast (casted only in combat or persistent spells in any state) - if (me->GetGlobalCooldown() == 0 && !me->hasUnitState(UNIT_STAT_CASTING)) + if (me->GetGlobalCooldown() == 0 && !me->HasUnitState(UNIT_STAT_CASTING)) { typedef std::vector<std::pair<Unit*, Spell*> > TargetSpellList; TargetSpellList targetSpellStore; @@ -427,7 +427,7 @@ void PetAI::MovementInform(uint32 moveType, uint32 data) me->GetCharmInfo()->SetIsReturning(false); me->GetCharmInfo()->SetIsFollowing(true); me->GetCharmInfo()->SetIsCommandAttack(false); - me->addUnitState(UNIT_STAT_FOLLOW); + me->AddUnitState(UNIT_STAT_FOLLOW); } } break; diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index 17f87003dfc..5c6d8ff2715 100755 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -38,7 +38,7 @@ void UnitAI::AttackStartCaster(Unit *victim, float dist) void UnitAI::DoMeleeAttackIfReady() { - if (me->hasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STAT_CASTING)) return; //Make sure our attack is ready and we aren't currently casting before checking distance @@ -64,7 +64,7 @@ void UnitAI::DoMeleeAttackIfReady() bool UnitAI::DoSpellAttackIfReady(uint32 spell) { - if (me->hasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STAT_CASTING)) return true; if (me->isAttackReady()) diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h index ae989fdb987..35537afa98e 100755 --- a/src/server/game/AI/CreatureAIImpl.h +++ b/src/server/game/AI/CreatureAIImpl.h @@ -576,7 +576,7 @@ inline bool CreatureAI::_EnterEvadeMode() inline void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered) { - if (!victim || (me->hasUnitState(UNIT_STAT_CASTING) && !triggered)) + if (!victim || (me->HasUnitState(UNIT_STAT_CASTING) && !triggered)) return; me->CastSpell(victim, spellId, triggered); @@ -589,7 +589,7 @@ inline void UnitAI::DoCastVictim(uint32 spellId, bool triggered) inline void UnitAI::DoCastAOE(uint32 spellId, bool triggered) { - if (!triggered && me->hasUnitState(UNIT_STAT_CASTING)) + if (!triggered && me->HasUnitState(UNIT_STAT_CASTING)) return; me->CastSpell((Unit*)NULL, spellId, triggered); diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index e69deffff52..c9960ee9545 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -580,7 +580,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { if (action.combat_movement.melee) { - me->addUnitState(UNIT_STAT_MELEE_ATTACKING); + me->AddUnitState(UNIT_STAT_MELEE_ATTACKING); me->SendMeleeAttackStart(victim); } if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE) @@ -594,7 +594,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 Unit* victim = me->getVictim(); if (action.combat_movement.melee && victim) { - me->clearUnitState(UNIT_STAT_MELEE_ATTACKING); + me->ClearUnitState(UNIT_STAT_MELEE_ATTACKING); me->SendMeleeAttackStop(victim); } if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 7717513d409..8ca697a1f46 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -90,7 +90,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* pWho) void npc_escortAI::MoveInLineOfSight(Unit* pWho) { - if (!me->hasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me)) + if (!me->HasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me)) { if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(pWho)) return; diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index d9f753306cc..5dca322f8a0 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -38,8 +38,8 @@ void FollowerAI::AttackStart(Unit* pWho) me->SetInCombatWith(pWho); pWho->SetInCombatWith(me); - if (me->hasUnitState(UNIT_STAT_FOLLOW)) - me->clearUnitState(UNIT_STAT_FOLLOW); + if (me->HasUnitState(UNIT_STAT_FOLLOW)) + me->ClearUnitState(UNIT_STAT_FOLLOW); if (IsCombatMovement()) me->GetMotionMaster()->MoveChase(pWho); @@ -88,7 +88,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* pWho) void FollowerAI::MoveInLineOfSight(Unit* pWho) { - if (!me->hasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me)) + if (!me->HasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me)) { if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(pWho)) return; @@ -340,9 +340,9 @@ Player* FollowerAI::GetLeaderForFollower() void FollowerAI::SetFollowComplete(bool bWithEndEvent) { - if (me->hasUnitState(UNIT_STAT_FOLLOW)) + if (me->HasUnitState(UNIT_STAT_FOLLOW)) { - me->clearUnitState(UNIT_STAT_FOLLOW); + me->ClearUnitState(UNIT_STAT_FOLLOW); me->StopMoving(); me->GetMotionMaster()->Clear(); @@ -369,9 +369,9 @@ void FollowerAI::SetFollowPaused(bool bPaused) { AddFollowState(STATE_FOLLOW_PAUSED); - if (me->hasUnitState(UNIT_STAT_FOLLOW)) + if (me->HasUnitState(UNIT_STAT_FOLLOW)) { - me->clearUnitState(UNIT_STAT_FOLLOW); + me->ClearUnitState(UNIT_STAT_FOLLOW); me->StopMoving(); me->GetMotionMaster()->Clear(); |
