[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

@ -190,7 +190,7 @@ Creature::~Creature()
void Creature::AddToWorld()
{
///- Register the creature for guid lookup
if(!IsInWorld() && GetObjectGuid().GetHigh() == HIGHGUID_UNIT)
if (!IsInWorld() && GetObjectGuid().IsCreatureOrVehicle())
GetMap()->GetObjectsStore().insert<Creature>(GetGUID(), (Creature*)this);
Unit::AddToWorld();
@ -199,7 +199,7 @@ void Creature::AddToWorld()
void Creature::RemoveFromWorld()
{
///- Remove the creature from the accessor
if(IsInWorld() && GetObjectGuid().GetHigh() == HIGHGUID_UNIT)
if (IsInWorld() && GetObjectGuid().IsCreatureOrVehicle())
GetMap()->GetObjectsStore().erase<Creature>(GetGUID(), (Creature*)NULL);
Unit::RemoveFromWorld();
@ -398,6 +398,8 @@ bool Creature::UpdateEntry(uint32 Entry, Team team, const CreatureData *data /*=
for(int i = 0; i < CREATURE_MAX_SPELLS; ++i)
m_spells[i] = GetCreatureInfo()->spells[i];
SetVehicleId(GetCreatureInfo()->vehicleId);
// if eventData set then event active and need apply spell_start
if (eventData)
ApplyGameEventSpells(eventData, true);