* This should help with the Linux build; thanks to Machiavelli/click.

* VehicleScript is now bound to the database (`creature_template`.`ScriptName`) and only works for creature vehicles.

--HG--
branch : trunk
This commit is contained in:
XTZGZoReX
2010-08-07 15:26:24 +02:00
parent f296addc47
commit 14aeb09945
3 changed files with 77 additions and 50 deletions
+14 -7
View File
@@ -109,7 +109,8 @@ void Vehicle::Install()
Reset();
sScriptMgr.OnInstall(this);
if (GetBase()->GetTypeId() == TYPEID_UNIT)
sScriptMgr.OnInstall(this);
}
void Vehicle::InstallAllAccessories()
@@ -132,7 +133,8 @@ void Vehicle::Uninstall()
RemoveAllPassengers();
sScriptMgr.OnUninstall(this);
if (GetBase()->GetTypeId() == TYPEID_UNIT)
sScriptMgr.OnUninstall(this);
}
void Vehicle::Die()
@@ -145,7 +147,8 @@ void Vehicle::Die()
RemoveAllPassengers();
sScriptMgr.OnDie(this);
if (GetBase()->GetTypeId() == TYPEID_UNIT)
sScriptMgr.OnDie(this);
}
void Vehicle::Reset()
@@ -163,7 +166,8 @@ void Vehicle::Reset()
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
}
sScriptMgr.OnReset(this);
if (GetBase()->GetTypeId() == TYPEID_UNIT)
sScriptMgr.OnReset(this);
}
void Vehicle::RemoveAllPassengers()
@@ -248,7 +252,8 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion)
// This is not good, we have to send update twice
accessory->SendMovementFlagUpdate();
sScriptMgr.OnInstallAccessory(this, accessory);
if (GetBase()->GetTypeId() == TYPEID_UNIT)
sScriptMgr.OnInstallAccessory(this, accessory);
}
}
@@ -329,7 +334,8 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
}
}
sScriptMgr.OnAddPassenger(this, unit, seatId);
if (GetBase()->GetTypeId() == TYPEID_UNIT)
sScriptMgr.OnAddPassenger(this, unit, seatId);
return true;
}
@@ -377,7 +383,8 @@ void Vehicle::RemovePassenger(Unit *unit)
if (unit->HasUnitMovementFlag(MOVEMENTFLAG_FLYING))
me->CastSpell(unit, 45472, true); // Parachute
sScriptMgr.OnRemovePassenger(this, unit);
if (GetBase()->GetTypeId() == TYPEID_UNIT)
sScriptMgr.OnRemovePassenger(this, unit);
}
void Vehicle::RelocatePassengers(float x, float y, float z, float ang)