diff options
| author | megamage <none@none> | 2009-08-15 20:36:54 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-08-15 20:36:54 -0500 |
| commit | c88304af95f9e289036a9c4e4e5433cc95044677 (patch) | |
| tree | 73e736c620d4e42e4f7381cc7c8150257baf765b /src/game/Vehicle.cpp | |
| parent | 917bf34a9855d68ebe13e94d9beeb1473f729230 (diff) | |
*Add some vehicle ai functions.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Vehicle.cpp')
| -rw-r--r-- | src/game/Vehicle.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp index 3cad7963d0b..d54bd04dcec 100644 --- a/src/game/Vehicle.cpp +++ b/src/game/Vehicle.cpp @@ -300,7 +300,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId) assert(!seat->second.passenger); } - sLog.outDebug("Unit %s enter vehicle entry %u id %u dbguid %u", unit->GetName(), GetEntry(), m_vehicleInfo->m_ID, GetDBTableGUIDLow()); + sLog.outDebug("Unit %s enter vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), GetEntry(), m_vehicleInfo->m_ID, GetDBTableGUIDLow(), (int32)seat->first); seat->second.passenger = unit; if(seat->second.seatInfo->IsUsable()) @@ -335,6 +335,9 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId) GetMap()->CreatureRelocation(this, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); } + if(AI()) + AI()->PassengerBoarded(unit, seat->first); + //if(unit->GetTypeId() == TYPEID_PLAYER) // ((Player*)unit)->SendTeleportAckMsg(); //unit->SendMovementFlagUpdate(); @@ -372,6 +375,9 @@ void Vehicle::RemovePassenger(Unit *unit) if(unit->GetTypeId() == TYPEID_PLAYER && seat->first == 0 && seat->second.seatInfo->m_flags & 0x800) RemoveCharmedBy(unit); + if(AI()) + AI()->PassengerLeft(unit, seat->first); + // only for flyable vehicles? //CastSpell(this, 45472, true); // Parachute } |
