aboutsummaryrefslogtreecommitdiff
path: root/src/game/Vehicle.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-03 13:51:05 -0500
committermegamage <none@none>2009-06-03 13:51:05 -0500
commitc70e6a003eb741bf3212dd4d11d917f765768ed0 (patch)
tree3fad3c257edb538b2a3d9e8d08fc020a8a11591e /src/game/Vehicle.cpp
parente861df87955bec89f87640947039f06e5e1b31a2 (diff)
*Use setcharmedby and removecharmedby in enter/exit vehicle functions.
*Fix build. --HG-- branch : trunk
Diffstat (limited to 'src/game/Vehicle.cpp')
-rw-r--r--src/game/Vehicle.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp
index f915c828c1d..94f828bfaf6 100644
--- a/src/game/Vehicle.cpp
+++ b/src/game/Vehicle.cpp
@@ -247,14 +247,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
//ChatHandler(player).PSendSysMessage("Enter seat %u %u", veSeat->m_ID, seat->first);
if(seat->first == 0 && seat->second.seatInfo->IsUsable()) // not right
- {
- setFaction(unit->getFaction());
- AI()->OnCharmed(true);
- GetMotionMaster()->MoveIdle();
- ((Player*)unit)->SetCharm(this, true);
- ((Player*)unit)->SetViewpoint(this, true);
- ((Player*)unit)->VehicleSpellInitialize();
- }
+ SetCharmedBy(unit, CHARM_TYPE_VEHICLE);
((Player*)unit)->BuildTeleportAckMsg(&data, unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetOrientation());
((Player*)unit)->GetSession()->SendPacket(&data);
@@ -294,13 +287,7 @@ void Vehicle::RemovePassenger(Unit *unit)
//SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
if(unit->GetTypeId() == TYPEID_PLAYER && seat->first == 0 && seat->second.seatInfo->IsUsable())
- {
- RestoreFaction();
- AI()->OnCharmed(false);
- ((Player*)unit)->SetCharm(this, false);
- ((Player*)unit)->SetViewpoint(this, false);
- ((Player*)unit)->SendRemoveControlBar();
- }
+ RemoveCharmedBy(unit);
// only for flyable vehicles?
//CastSpell(this, 45472, true); // Parachute