Core/Battlefield: Cleanup
This commit is contained in:
@@ -810,15 +810,15 @@ Creature *Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Create creature
|
//Create creature
|
||||||
Creature* pCreature = new Creature;
|
Creature* creature = new Creature;
|
||||||
if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, team, x, y, z, o))
|
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, team, x, y, z, o))
|
||||||
{
|
{
|
||||||
sLog->outError("Can't create creature entry: %u", entry);
|
sLog->outError("Can't create creature entry: %u", entry);
|
||||||
delete pCreature;
|
delete creature;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pCreature->SetHomePosition(x, y, z, o);
|
creature->SetHomePosition(x, y, z, o);
|
||||||
|
|
||||||
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry);
|
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry);
|
||||||
if (!cinfo)
|
if (!cinfo)
|
||||||
@@ -827,14 +827,14 @@ Creature *Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
// force using DB speeds -- do we really need this?
|
// force using DB speeds -- do we really need this?
|
||||||
pCreature->SetSpeed(MOVE_WALK, cinfo->speed_walk);
|
creature->SetSpeed(MOVE_WALK, cinfo->speed_walk);
|
||||||
pCreature->SetSpeed(MOVE_RUN, cinfo->speed_run);
|
creature->SetSpeed(MOVE_RUN, cinfo->speed_run);
|
||||||
|
|
||||||
// Set creature in world
|
// Set creature in world
|
||||||
map->AddToMap(pCreature);
|
map->AddToMap(creature);
|
||||||
pCreature->setActive(true);
|
creature->setActive(true);
|
||||||
|
|
||||||
return pCreature;
|
return creature;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method for spawning gameobject on map
|
// Method for spawning gameobject on map
|
||||||
|
|||||||
@@ -253,23 +253,23 @@ class go_wg_vehicle_teleporter : public GameObjectScript
|
|||||||
if (uiCheckTimer <= diff)
|
if (uiCheckTimer <= diff)
|
||||||
{
|
{
|
||||||
for (uint8 i = 0; i < 4; i++)
|
for (uint8 i = 0; i < 4; i++)
|
||||||
if (Creature* pVehicle = go->FindNearestCreature(Vehicules[i], 3.0f, true))
|
if (Creature* vehicle = go->FindNearestCreature(Vehicules[i], 3.0f, true))
|
||||||
if (!pVehicle->HasAura(SPELL_VEHICLE_TELEPORT))
|
if (!vehicle->HasAura(SPELL_VEHICLE_TELEPORT))
|
||||||
{
|
{
|
||||||
if (pVehicle->GetVehicle())
|
if (vehicle->GetVehicle())
|
||||||
{
|
{
|
||||||
if (Unit* player = pVehicle->GetVehicle()->GetPassenger(0))
|
if (Unit* player = vehicle->GetVehicle()->GetPassenger(0))
|
||||||
{
|
{
|
||||||
uint32 gofaction = go->GetUInt32Value(GAMEOBJECT_FACTION);
|
uint32 gofaction = go->GetUInt32Value(GAMEOBJECT_FACTION);
|
||||||
uint32 plfaction = player->getFaction();
|
uint32 plfaction = player->getFaction();
|
||||||
if (gofaction == plfaction)
|
if (gofaction == plfaction)
|
||||||
{
|
{
|
||||||
pVehicle->CastSpell(pVehicle, SPELL_VEHICLE_TELEPORT, true);
|
vehicle->CastSpell(vehicle, SPELL_VEHICLE_TELEPORT, true);
|
||||||
if (Creature* TargetTeleport = pVehicle->FindNearestCreature(23472, 100.0f, true))
|
if (Creature* TargetTeleport = vehicle->FindNearestCreature(23472, 100.0f, true))
|
||||||
{
|
{
|
||||||
float x, y, z, o;
|
float x, y, z, o;
|
||||||
TargetTeleport->GetPosition(x, y, z, o);
|
TargetTeleport->GetPosition(x, y, z, o);
|
||||||
pVehicle->GetVehicle()->TeleportVehicle(x, y, z, o);
|
vehicle->GetVehicle()->TeleportVehicle(x, y, z, o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user