[11385] Add support for static vehicle spawns

Signed-off-by: zergtmn <zerg@myisp.com>
This commit is contained in:
zergtmn 2011-04-20 23:23:47 +06:00
parent 75e1e7c3a3
commit 2835aa5f20
32 changed files with 115 additions and 331 deletions

View file

@ -230,10 +230,6 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
{
uint16 moveFlags2 = (isType(TYPEMASK_UNIT) ? ((Unit*)this)->m_movementInfo.GetMovementFlags2() : MOVEFLAG2_NONE);
if(GetTypeId() == TYPEID_UNIT)
if(((Creature*)this)->IsVehicle())
moveFlags2 |= MOVEFLAG2_ALLOW_PITCHING; // always allow pitch
*data << uint16(updateFlags); // update flags
// 0x20
@ -256,7 +252,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
// (ok) most seem to have this
unit->m_movementInfo.AddMovementFlag(MOVEFLAG_LEVITATING);
if (!((Creature*)unit)->hasUnitState(UNIT_STAT_MOVING))
if (!unit->hasUnitState(UNIT_STAT_ROOT))
{
// (ok) possibly some "hover" mode
unit->m_movementInfo.AddMovementFlag(MOVEFLAG_ROOT);
@ -506,9 +502,9 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
}
// 0x80
if(updateFlags & UPDATEFLAG_VEHICLE) // unused for now
if (updateFlags & UPDATEFLAG_VEHICLE)
{
*data << uint32(((Vehicle*)this)->GetVehicleId()); // vehicle id
*data << uint32(((Unit*)this)->GetVehicleInfo()->GetEntry()->m_ID); // vehicle id
*data << float(((WorldObject*)this)->GetOrientation());
}
@ -1664,7 +1660,7 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
if (x == 0.0f && y == 0.0f && z == 0.0f)
pos = CreatureCreatePos(this, GetOrientation(), CONTACT_DISTANCE, ang);
if (!pCreature->Create(GetMap()->GenerateLocalLowGuid(HIGHGUID_UNIT), pos, cinfo, team))
if (!pCreature->Create(GetMap()->GenerateLocalLowGuid(cinfo->GetHighGuid()), pos, cinfo, team))
{
delete pCreature;
return NULL;