aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author_manuel_ <manue.l@live.com.ar>2010-04-04 20:00:07 -0300
committer_manuel_ <manue.l@live.com.ar>2010-04-04 20:00:07 -0300
commit160666fa0007ac21920ac438688787f8d7b74004 (patch)
tree454de929db3ea31505422c7bd19c74e4342bb632 /src
parenta5c09f5d44e2be23307bb5ee2befc29f3336472a (diff)
Fixed faction issue with vehicles in BattleGrounds. Thanks to Gyullo for help and Rat for idea.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Unit.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 92c0da3c2c0..6f539d92646 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -14993,7 +14993,10 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type)
}
// Set charmed
- setFaction(charmer->getFaction());
+ Map* pMap = GetMap();
+ if (!IsVehicle() || (IsVehicle() && pMap && !pMap->IsBattleGround()))
+ setFaction(charmer->getFaction());
+
charmer->SetCharm(this, true);
if (GetTypeId() == TYPEID_UNIT)
@@ -15090,7 +15093,9 @@ void Unit::RemoveCharmedBy(Unit *charmer)
CombatStop(); //TODO: CombatStop(true) may cause crash (interrupt spells)
getHostileRefManager().deleteReferences();
DeleteThreatList();
- RestoreFaction();
+ Map* pMap = GetMap();
+ if (!IsVehicle() || (IsVehicle() && pMap && !pMap->IsBattleGround()))
+ RestoreFaction();
GetMotionMaster()->InitDefault();
if (type == CHARM_TYPE_POSSESS)