mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
*More work on vehicle.
--HG-- branch : trunk
This commit is contained in:
@@ -518,8 +518,8 @@ class TRINITY_DLL_SPEC WorldObject : public Object
|
||||
Map * GetMap() const { return m_map ? m_map : const_cast<WorldObject*>(this)->_getMap(); }
|
||||
Map * FindMap() const { return m_map ? m_map : const_cast<WorldObject*>(this)->_findMap(); }
|
||||
Map const* GetBaseMap() const;
|
||||
TempSummon* SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime);
|
||||
Vehicle* SummonVehicle(uint32 entry, float x, float y, float z, float ang);
|
||||
TempSummon* SummonCreature(uint32 id, float x, float y, float z, float ang = 0,TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN,uint32 despwtime = 0);
|
||||
Vehicle* SummonVehicle(uint32 entry, float x, float y, float z, float ang = 0);
|
||||
GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime);
|
||||
Creature* SummonTrigger(float x, float y, float z, float ang, uint32 dur, CreatureAI* (*GetAI)(Creature*) = NULL);
|
||||
bool isActiveObject() const { return m_isActive; }
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -55,6 +55,7 @@ class Vehicle : public Creature
|
||||
Vehicle* HasEmptySeat(int8 seatNum) const;
|
||||
bool AddPassenger(Unit *passenger, int8 seatNum = -1);
|
||||
void RemovePassenger(Unit *passenger);
|
||||
void InstallAccessory(uint32 entry, int8 seatNum);
|
||||
void Dismiss();
|
||||
|
||||
bool LoadFromDB(uint32 guid, Map *map);
|
||||
|
||||
Reference in New Issue
Block a user