aboutsummaryrefslogtreecommitdiff
path: root/src/game/Vehicle.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-30 22:15:05 -0500
committermegamage <none@none>2009-05-30 22:15:05 -0500
commit8d1f4f9ea0beb503e2a3014abb95263e501ef1c5 (patch)
tree41d48951c315129dee817befa40d4dab90d3fd14 /src/game/Vehicle.cpp
parentb5778357d9d8c5fb10da5d99c46b48250578cb49 (diff)
*Provide another way to implement dynamic spawns. Now a creature will call its zonescript before spawn to determine the spawned entry. This can be used to implement zones such as wintergrasp with less data requirement (only need to know the entry of counterpart creatures, not require spawn points)
*Use zonescript as basic class of opvp script and dugeon script (can also be used for bg) *Store zonescript in worldobject. *Add door for sapphiron. --HG-- branch : trunk
Diffstat (limited to 'src/game/Vehicle.cpp')
-rw-r--r--src/game/Vehicle.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp
index 0bcdf088bc2..aaf97b3e413 100644
--- a/src/game/Vehicle.cpp
+++ b/src/game/Vehicle.cpp
@@ -90,9 +90,9 @@ void Vehicle::Update(uint32 diff)
// ModifyPower(POWER_ENERGY, 1);
}
-bool Vehicle::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 vehicleId, uint32 team, const CreatureData * data)
+bool Vehicle::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 vehicleId, uint32 team, float x, float y, float z, float o, const CreatureData * data)
{
- if(!Creature::Create(guidlow, map, phaseMask, Entry, team, data))
+ if(!Creature::Create(guidlow, map, phaseMask, Entry, team, x, y, z, o, data))
return false;
SetVehicleId(vehicleId);
@@ -338,16 +338,9 @@ bool Vehicle::LoadFromDB(uint32 guid, Map *map)
if (map->GetInstanceId() != 0) guid = objmgr.GenerateLowGuid(HIGHGUID_VEHICLE);
uint16 team = 0;
- if(!Create(guid,map,data->phaseMask,data->id,id,team,data))
+ if(!Create(guid,map,data->phaseMask,data->id,id,team,data->posX,data->posY,data->posZ,data->orientation,data))
return false;
- Relocate(data->posX,data->posY,data->posZ,data->orientation);
-
- if(!IsPositionValid())
- {
- sLog.outError("Creature (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",GetGUIDLow(),GetEntry(),GetPositionX(),GetPositionY());
- return false;
- }
//We should set first home position, because then AI calls home movement
SetHomePosition(data->posX,data->posY,data->posZ,data->orientation);