From 787cd7fcb51df492769bd3594efb26891a4dbcd5 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 21 Apr 2009 13:49:39 -0500 Subject: *More work on vehicle. --HG-- branch : trunk --- src/game/Vehicle.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/game/Vehicle.cpp') diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp index 48edcdd9340..2be74bd628b 100644 --- a/src/game/Vehicle.cpp +++ b/src/game/Vehicle.cpp @@ -157,6 +157,17 @@ Vehicle* Vehicle::HasEmptySeat(int8 seatNum) const return NULL; } +void Vehicle::InstallAccessory(uint32 entry, int8 seatNum) +{ + Creature *accessory = SummonCreature(entry, GetPositionX(), GetPositionY(), GetPositionZ()); + if(!accessory) + return; + + accessory->m_Vehicle = this; + accessory->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); + AddPassenger(accessory, seatNum); +} + bool Vehicle::AddPassenger(Unit *unit, int8 seatNum) { if(unit->m_Vehicle != this) -- cgit v1.2.3