aboutsummaryrefslogtreecommitdiff
path: root/src/game/Transports.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Transports.cpp')
-rw-r--r--src/game/Transports.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/game/Transports.cpp b/src/game/Transports.cpp
index 3f13ffd1ba1..68476392373 100644
--- a/src/game/Transports.cpp
+++ b/src/game/Transports.cpp
@@ -37,7 +37,7 @@ void MapManager::LoadTransports()
uint32 count = 0;
- if( !result )
+ if ( !result )
{
barGoLink bar( 1 );
bar.step();
@@ -63,14 +63,14 @@ void MapManager::LoadTransports()
const GameObjectInfo *goinfo = objmgr.GetGameObjectInfo(entry);
- if(!goinfo)
+ if (!goinfo)
{
sLog.outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template missing", entry, name.c_str());
delete t;
continue;
}
- if(goinfo->type != GAMEOBJECT_TYPE_MO_TRANSPORT)
+ if (goinfo->type != GAMEOBJECT_TYPE_MO_TRANSPORT)
{
sLog.outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template type wrong", entry, name.c_str());
delete t;
@@ -81,7 +81,7 @@ void MapManager::LoadTransports()
std::set<uint32> mapsUsed;
- if(!t->GenerateWaypoints(goinfo->moTransport.taxiPathId, mapsUsed))
+ if (!t->GenerateWaypoints(goinfo->moTransport.taxiPathId, mapsUsed))
// skip transports with empty waypoints list
{
sLog.outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.",goinfo->moTransport.taxiPathId);
@@ -94,7 +94,7 @@ void MapManager::LoadTransports()
x = t->m_WayPoints[0].x; y = t->m_WayPoints[0].y; z = t->m_WayPoints[0].z; mapid = t->m_WayPoints[0].mapid; o = 1;
// creates the Gameobject
- if(!t->Create(entry, mapid, x, y, z, o, 100, 0))
+ if (!t->Create(entry, mapid, x, y, z, o, 100, 0))
{
delete t;
continue;
@@ -117,7 +117,7 @@ void MapManager::LoadTransports()
// check transport data DB integrity
result = WorldDatabase.Query("SELECT gameobject.guid,gameobject.id,transports.name FROM gameobject,transports WHERE gameobject.id = transports.entry");
- if(result) // wrong data found
+ if (result) // wrong data found
{
do
{
@@ -142,7 +142,7 @@ bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z,
Relocate(x,y,z,ang);
// instance id and phaseMask isn't set to values different from std.
- if(!IsPositionValid())
+ if (!IsPositionValid())
{
sLog.outError("Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
guidlow,x,y);
@@ -175,7 +175,7 @@ bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z,
SetGoType(GameobjectTypes(goinfo->type));
SetGoAnimProgress(animprogress);
- if(dynflags)
+ if (dynflags)
SetUInt32Value(GAMEOBJECT_DYNAMIC, MAKE_PAIR32(0, dynflags));
SetName(goinfo->name);
@@ -262,7 +262,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
if (keyFrames[i].actionflag == 2)
{
// remember first stop frame
- if(firstStop == -1)
+ if (firstStop == -1)
firstStop = i;
lastStop = i;
}
@@ -399,7 +399,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
// sLog.outString("T: %d, x: %f, y: %f, z: %f, t:%d", t, pos.x, pos.y, pos.z, teleport);
/*
- if(keyFrames[i+1].delay > 5)
+ if (keyFrames[i+1].delay > 5)
pos.delayed = true;
*/
//if (teleport)
@@ -463,7 +463,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
SetMap(newMap);
assert (GetMap());
- if(oldMap != newMap)
+ if (oldMap != newMap)
{
UpdateForMap(oldMap);
UpdateForMap(newMap);
@@ -472,7 +472,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
bool Transport::AddPassenger(Player* passenger)
{
- if(m_passengers.insert(passenger).second)
+ if (m_passengers.insert(passenger).second)
sLog.outDetail("Player %s boarded transport %s.", passenger->GetName(), GetName());
return true;
}
@@ -487,7 +487,7 @@ bool Transport::RemovePassenger(Player* passenger)
void Transport::CheckForEvent(uint32 entry, uint32 wp_id)
{
uint32 key = entry*100+wp_id;
- if(objmgr.TransportEventMap.find(key) != objmgr.TransportEventMap.end())
+ if (objmgr.TransportEventMap.find(key) != objmgr.TransportEventMap.end())
GetMap()->ScriptsStart(sEventScripts, objmgr.TransportEventMap[key], this, NULL);
}
@@ -512,7 +512,7 @@ void Transport::Update(uint32 /*p_time*/)
Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z);
}
/*
- if(m_curr->second.delayed)
+ if (m_curr->second.delayed)
{
switch (GetEntry())
{
@@ -557,14 +557,14 @@ void Transport::Update(uint32 /*p_time*/)
void Transport::UpdateForMap(Map const* targetMap)
{
Map::PlayerList const& pl = targetMap->GetPlayers();
- if(pl.isEmpty())
+ if (pl.isEmpty())
return;
- if(GetMapId()==targetMap->GetId())
+ if (GetMapId()==targetMap->GetId())
{
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
{
- if(this != itr->getSource()->GetTransport())
+ if (this != itr->getSource()->GetTransport())
{
UpdateData transData;
BuildCreateUpdateBlockForPlayer(&transData, itr->getSource());
@@ -582,7 +582,7 @@ void Transport::UpdateForMap(Map const* targetMap)
transData.BuildPacket(&out_packet);
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
- if(this != itr->getSource()->GetTransport())
+ if (this != itr->getSource()->GetTransport())
itr->getSource()->SendDirectMessage(&out_packet);
}
}