aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authorRat <none@none>2010-04-29 21:22:25 +0200
committerRat <none@none>2010-04-29 21:22:25 +0200
commit757fbfba83f466bd3f757998a705407cfe156868 (patch)
treee8b238532f1d342532b20279bdd71bf70cca69aa /src/game/Unit.cpp
parent946ded461927ddb352d2f20041b70ecb7f568cf6 (diff)
*implemented 'empty' VehicleAI
NOTE: VehicleAI::UpdateAI runs even while the vehicle is mounted! --HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 9baa91b7fbc..65187a92789 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -15167,17 +15167,21 @@ void Unit::RemoveCharmedBy(Unit *charmer)
if (GetTypeId() == TYPEID_UNIT)
{
this->ToCreature()->AI()->OnCharmed(false);
- this->ToCreature()->AIM_Initialize();
- if (this->ToCreature()->AI() && charmer && charmer->isAlive())
- this->ToCreature()->AI()->AttackStart(charmer);
- /*if (isAlive() && this->ToCreature()->IsAIEnabled)
+ if (type != CHARM_TYPE_VEHICLE)//Vehicles' AI is never modified
{
- if (charmer && !IsFriendlyTo(charmer))
+ this->ToCreature()->AIM_Initialize();
+
+ if (this->ToCreature()->AI() && charmer && charmer->isAlive())
this->ToCreature()->AI()->AttackStart(charmer);
- else
- this->ToCreature()->AI()->EnterEvadeMode();
- }*/
+ /*if (isAlive() && this->ToCreature()->IsAIEnabled)
+ {
+ if (charmer && !IsFriendlyTo(charmer))
+ this->ToCreature()->AI()->AttackStart(charmer);
+ else
+ this->ToCreature()->AI()->EnterEvadeMode();
+ }*/
+ }
}
else
this->ToPlayer()->SetClientControl(this, 1);