OregonCore  revision fb2a440-git
Your Favourite TBC server
Transports.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore Project. See AUTHORS file for Copyright information
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #include "Common.h"
19 #include "Transports.h"
20 #include "MapManager.h"
21 #include "ObjectMgr.h"
22 #include "WorldPacket.h"
23 #include "DBCStores.h"
24 #include "Player.h"
25 
27 {
28  QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, name, period FROM transports");
29 
30  uint32 count = 0;
31 
32  if (!result)
33  {
34  sLog.outString(">> Loaded %u transports", count);
35  return;
36  }
37 
38  do
39  {
40  Transport* t = new Transport;
41 
42  Field* fields = result->Fetch();
43 
44  uint32 entry = fields[0].GetUInt32();
45  std::string name = fields[1].GetCppString();
46  t->m_period = fields[2].GetUInt32();
47 
48  const GameObjectInfo* goinfo = sObjectMgr.GetGameObjectInfo(entry);
49 
50  if (!goinfo)
51  {
52  sLog.outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template missing", entry, name.c_str());
53  delete t;
54  continue;
55  }
56 
57  if (goinfo->type != GAMEOBJECT_TYPE_MO_TRANSPORT)
58  {
59  sLog.outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template type wrong", entry, name.c_str());
60  delete t;
61  continue;
62  }
63 
64  // sLog.outString("Loading transport %d between %s, %s", entry, name.c_str(), goinfo->name);
65 
66  std::set<uint32> mapsUsed;
67 
68  if (!t->GenerateWaypoints(goinfo->moTransport.taxiPathId, mapsUsed))
69  // skip transports with empty waypoints list
70  {
71  sLog.outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.", goinfo->moTransport.taxiPathId);
72  delete t;
73  continue;
74  }
75 
76  float x, y, z, o;
77  uint32 mapid;
78  x = t->m_WayPoints[0].x;
79  y = t->m_WayPoints[0].y;
80  z = t->m_WayPoints[0].z;
81  mapid = t->m_WayPoints[0].mapid;
82  o = 1;
83 
84  // creates the Gameobject
85  if (!t->Create(entry, mapid, x, y, z, o, 100, 0))
86  {
87  delete t;
88  continue;
89  }
90 
91  m_Transports.insert(t);
92 
93  for (std::set<uint32>::iterator i = mapsUsed.begin(); i != mapsUsed.end(); ++i)
94  m_TransportsByMap[*i].insert(t);
95 
96  //If we someday decide to use the grid to track transports, here:
97  t->SetMap(MapManager::Instance().CreateMap(mapid, t, 0));
98 
99  //t->GetMap()->Add<GameObject>((GameObject* )t);
100 
101  ++count;
102  }
103  while (result->NextRow());
104 
105  sLog.outString(">> Loaded %u transports", count);
106 
107  // check transport data DB integrity
108  result = WorldDatabase.Query("SELECT gameobject.guid,gameobject.id,transports.name FROM gameobject,transports WHERE gameobject.id = transports.entry");
109  if (result) // wrong data found
110  {
111  do
112  {
113  Field* fields = result->Fetch();
114 
115  uint32 guid = fields[0].GetUInt32();
116  uint32 entry = fields[1].GetUInt32();
117  std::string name = fields[2].GetCppString();
118  sLog.outErrorDb("Transport %u '%s' has record (GUID: %u) in gameobject. Transports MUST NOT have any records in gameobject or its behavior will be unpredictable/bugged.", entry, name.c_str(), guid);
119  }
120  while (result->NextRow());
121  }
122 }
123 
124 Transport::Transport() : GameObject(), _delayedAddModel(false)
125 {
126  // 2.3.2 - 0x5A
128 }
129 
130 bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress, uint32 dynflags)
131 {
132  Relocate(x, y, z, ang);
133 
134  if (!IsPositionValid())
135  {
136  sLog.outError("Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
137  guidlow, x, y);
138  return false;
139  }
140 
142 
143  GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(guidlow);
144 
145  if (!goinfo)
146  {
147  sLog.outErrorDb("Transport not created: entry in gameobject_template not found, guidlow: %u map: %u (X: %f Y: %f Z: %f) ang: %f", guidlow, mapid, x, y, z, ang);
148  return false;
149  }
150 
151  m_goInfo = goinfo;
152 
153  SetObjectScale(goinfo->size);
154 
157 
159 
161 
163  SetGoType(GameobjectTypes(goinfo->type));
164 
165  SetGoAnimProgress(animprogress);
166  if (dynflags)
168 
169  SetName(goinfo->name);
170 
172 
173  return true;
174 }
175 
176 struct keyFrame
177 {
178  explicit keyFrame(TaxiPathNodeEntry const& _node) : node(&_node),
179  distSinceStop(-1.0f), distUntilStop(-1.0f), distFromPrev(-1.0f), tFrom(0.0f), tTo(0.0f)
180  {
181  }
182 
184 
188  float tFrom, tTo;
189 };
190 
191 bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32>& mapids)
192 {
193  if (pathid >= sTaxiPathNodesByPath.size())
194  return false;
195 
196  TaxiPathNodeList const& path = sTaxiPathNodesByPath[pathid];
197 
198  std::vector<keyFrame> keyFrames;
199  int mapChange = 0;
200  mapids.clear();
201  for (size_t i = 1; i < path.size() - 1; ++i)
202  {
203  if (mapChange == 0)
204  {
205  TaxiPathNodeEntry const& node_i = path[i];
206  if (node_i.mapid == path[i + 1].mapid)
207  {
208  keyFrame k(node_i);
209  keyFrames.push_back(k);
210  mapids.insert(k.node->mapid);
211  }
212  else
213  mapChange = 1;
214  }
215  else
216  --mapChange;
217  }
218 
219  int lastStop = -1;
220  int firstStop = -1;
221 
222  // first cell is arrived at by teleportation :S
223  keyFrames[0].distFromPrev = 0;
224  if (keyFrames[0].node->actionFlag == 2)
225  lastStop = 0;
226 
227  // find the rest of the distances between key points
228  for (size_t i = 1; i < keyFrames.size(); ++i)
229  {
230  if ((keyFrames[i].node->actionFlag == 1) || (keyFrames[i].node->mapid != keyFrames[i - 1].node->mapid))
231  keyFrames[i].distFromPrev = 0;
232  else
233  {
234  keyFrames[i].distFromPrev =
235  sqrt(pow(keyFrames[i].node->x - keyFrames[i - 1].node->x, 2) +
236  pow(keyFrames[i].node->y - keyFrames[i - 1].node->y, 2) +
237  pow(keyFrames[i].node->z - keyFrames[i - 1].node->z, 2));
238  }
239  if (keyFrames[i].node->actionFlag == 2)
240  {
241  // remember first stop frame
242  if (firstStop == -1)
243  firstStop = i;
244  lastStop = i;
245  }
246  }
247 
248  float tmpDist = 0;
249  for (size_t i = 0; i < keyFrames.size(); ++i)
250  {
251  int j = (i + lastStop) % keyFrames.size();
252  if (keyFrames[j].node->actionFlag == 2)
253  tmpDist = 0;
254  else
255  tmpDist += keyFrames[j].distFromPrev;
256  keyFrames[j].distSinceStop = tmpDist;
257  }
258 
259  for (int i = int(keyFrames.size()) - 1; i >= 0; i--)
260  {
261  int j = (i + (firstStop + 1)) % keyFrames.size();
262  tmpDist += keyFrames[(j + 1) % keyFrames.size()].distFromPrev;
263  keyFrames[j].distUntilStop = tmpDist;
264  if (keyFrames[j].node->actionFlag == 2)
265  tmpDist = 0;
266  }
267 
268  for (size_t i = 0; i < keyFrames.size(); ++i)
269  {
270  if (keyFrames[i].distSinceStop < (30 * 30 * 0.5f))
271  keyFrames[i].tFrom = sqrt(2 * keyFrames[i].distSinceStop);
272  else
273  keyFrames[i].tFrom = ((keyFrames[i].distSinceStop - (30 * 30 * 0.5f)) / 30) + 30;
274 
275  if (keyFrames[i].distUntilStop < (30 * 30 * 0.5f))
276  keyFrames[i].tTo = sqrt(2 * keyFrames[i].distUntilStop);
277  else
278  keyFrames[i].tTo = ((keyFrames[i].distUntilStop - (30 * 30 * 0.5f)) / 30) + 30;
279 
280  keyFrames[i].tFrom *= 1000;
281  keyFrames[i].tTo *= 1000;
282  }
283 
284  // for (int i = 0; i < keyFrames.size(); ++i) {
285  // sLog.outString("%f, %f, %f, %f, %f, %f, %f", keyFrames[i].x, keyFrames[i].y, keyFrames[i].distUntilStop, keyFrames[i].distSinceStop, keyFrames[i].distFromPrev, keyFrames[i].tFrom, keyFrames[i].tTo);
286  // }
287 
288  // Now we're completely set up; we can move along the length of each waypoint at 100 ms intervals
289  // speed = max(30, t) (remember x = 0.5s^2, and when accelerating, a = 1 unit/s^2
290  int t = 0;
291  bool teleport = false;
292  if (keyFrames[keyFrames.size() - 1].node->mapid != keyFrames[0].node->mapid)
293  teleport = true;
294 
295  WayPoint pos(keyFrames[0].node->mapid, keyFrames[0].node->x, keyFrames[0].node->y, keyFrames[0].node->z, teleport,
296  keyFrames[0].node->arrivalEventID, keyFrames[0].node->departureEventID);
297  m_WayPoints[0] = pos;
298  t += keyFrames[0].node->delay * 1000;
299 
300  uint32 cM = keyFrames[0].node->mapid;
301  for (size_t i = 0; i < keyFrames.size() - 1; ++i)
302  {
303  float d = 0;
304  float tFrom = keyFrames[i].tFrom;
305  float tTo = keyFrames[i].tTo;
306 
307  // keep the generation of all these points; we use only a few now, but may need the others later
308  if (((d < keyFrames[i + 1].distFromPrev) && (tTo > 0)))
309  {
310  while ((d < keyFrames[i + 1].distFromPrev) && (tTo > 0))
311  {
312  tFrom += 100;
313  tTo -= 100;
314 
315  if (d > 0)
316  {
317  float newX, newY, newZ;
318  newX = keyFrames[i].node->x + (keyFrames[i + 1].node->x - keyFrames[i].node->x) * d / keyFrames[i + 1].distFromPrev;
319  newY = keyFrames[i].node->y + (keyFrames[i + 1].node->y - keyFrames[i].node->y) * d / keyFrames[i + 1].distFromPrev;
320  newZ = keyFrames[i].node->z + (keyFrames[i + 1].node->z - keyFrames[i].node->z) * d / keyFrames[i + 1].distFromPrev;
321 
322  bool teleport = false;
323  if (keyFrames[i].node->mapid != cM)
324  {
325  teleport = true;
326  cM = keyFrames[i].node->mapid;
327  }
328 
329  // sLog.outString("T: %d, D: %f, x: %f, y: %f, z: %f", t, d, newX, newY, newZ);
330  WayPoint pos(keyFrames[i].node->mapid, newX, newY, newZ, teleport, i);
331  if (teleport)
332  m_WayPoints[t] = pos;
333  }
334 
335  if (tFrom < tTo) // caught in tFrom dock's "gravitational pull"
336  {
337  if (tFrom <= 30000)
338  d = 0.5f * (tFrom / 1000) * (tFrom / 1000);
339  else
340  d = 0.5f * 30 * 30 + 30 * ((tFrom - 30000) / 1000);
341  d = d - keyFrames[i].distSinceStop;
342  }
343  else
344  {
345  if (tTo <= 30000)
346  d = 0.5f * (tTo / 1000) * (tTo / 1000);
347  else
348  d = 0.5f * 30 * 30 + 30 * ((tTo - 30000) / 1000);
349  d = keyFrames[i].distUntilStop - d;
350  }
351  t += 100;
352  }
353  t -= 100;
354  }
355 
356  if (keyFrames[i + 1].tFrom > keyFrames[i + 1].tTo)
357  t += 100 - ((long)keyFrames[i + 1].tTo % 100);
358  else
359  t += (long)keyFrames[i + 1].tTo % 100;
360 
361  bool teleport = false;
362  if ((keyFrames[i + 1].node->actionFlag == 1) || (keyFrames[i + 1].node->mapid != keyFrames[i].node->mapid))
363  {
364  teleport = true;
365  cM = keyFrames[i + 1].node->mapid;
366  }
367 
368  WayPoint pos(keyFrames[i + 1].node->mapid, keyFrames[i + 1].node->x, keyFrames[i + 1].node->y, keyFrames[i + 1].node->z, teleport,
369  keyFrames[i + 1].node->arrivalEventID, keyFrames[i + 1].node->departureEventID);
370 
371  // sLog.outString("T: %d, x: %f, y: %f, z: %f, t:%d", t, pos.x, pos.y, pos.z, teleport);
372 
373  //if (teleport)
374  m_WayPoints[t] = pos;
375 
376  t += keyFrames[i + 1].node->delay * 1000;
377  // sLog.outString("------");
378  }
379 
380  uint32 timer = t;
381 
382  // sLog.outDetail(" Generated %d waypoints, total time %u.", m_WayPoints.size(), timer);
383 
384  m_curr = m_WayPoints.begin();
387  m_pathTime = timer;
388 
389  m_nextNodeTime = m_curr->first;
390 
391  return true;
392 }
393 
394 Transport::WayPointMap::iterator Transport::GetNextWayPoint()
395 {
396  WayPointMap::iterator iter = m_curr;
397  ++iter;
398  if (iter == m_WayPoints.end())
399  iter = m_WayPoints.begin();
400  return iter;
401 }
402 
403 void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
404 {
405  Map* oldMap = GetMap();
406  Relocate(x, y, z);
407 
408  if (m_model)
409  {
410  if (oldMap->Contains(*m_model))
411  oldMap->Remove(*m_model);
413  }
414 
415  for (PlayerSet::iterator itr = m_passengers.begin(); itr != m_passengers.end();)
416  {
417  PlayerSet::iterator it2 = itr;
418  ++itr;
419 
420  Player* plr = *it2;
421  if (!plr)
422  {
423  m_passengers.erase(it2);
424  continue;
425  }
426 
427  if (plr->isDead() && !plr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
428  plr->ResurrectPlayer(1.0);
429  plr->TeleportTo(newMapid, x, y, z, GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT);
430 
431  //WorldPacket data(SMSG_811, 4);
432  //data << uint32(0);
433  //plr->GetSession()->SendPacket(&data);
434  }
435 
436  //we need to create and save new Map object with 'newMapid' because if not done -> lead to invalid Map object reference...
437  //player far teleport would try to create same instance, but we need it NOW for transport...
438 
439  ResetMap();
440  Map* newMap = MapManager::Instance().CreateMap(newMapid, this, 0);
441  ASSERT(newMap);
442  SetMap(newMap);
443 
444  if (oldMap != newMap)
445  {
446  UpdateForMap(oldMap);
447  UpdateForMap(newMap);
448  }
449 }
450 
452 {
453  if (m_passengers.find(passenger) == m_passengers.end())
454  {
455  sLog.outDetail("Player %s boarded transport %s.", passenger->GetName(), GetName());
456  m_passengers.insert(passenger);
457  }
458  return true;
459 }
460 
462 {
463  if (m_passengers.erase(passenger))
464  sLog.outDetail("Player %s removed from transport %s.", passenger->GetName(), GetName());
465  return true;
466 }
467 
469 {
470  uint32 key = entry * 100 + wp_id;
471  if (sObjectMgr.TransportEventMap.find(key) != sObjectMgr.TransportEventMap.end())
472  GetMap()->ScriptsStart(sEventScripts, sObjectMgr.TransportEventMap[key], this, NULL);
473 }
474 
475 void Transport::Update(uint32 /*p_time*/)
476 {
477  if (m_WayPoints.size() <= 1)
478  return;
479 
480  // Add model to map after we are fully done with moving maps
481  if (_delayedAddModel)
482  {
483  _delayedAddModel = false;
484  if (m_model)
485  GetMap()->Insert(*m_model);
486  }
487 
488  m_timer = getMSTime() % m_period;
489  while (((m_timer - m_curr->first) % m_pathTime) > ((m_next->first - m_curr->first) % m_pathTime))
490  {
491  DoEventIfAny(*m_curr, true);
492 
495 
496  DoEventIfAny(*m_curr, false);
497 
498  // first check help in case client-server transport coordinates de-synchronization
499  if (m_curr->second.mapid != GetMapId() || m_curr->second.teleport)
500  TeleportTransport(m_curr->second.mapid, m_curr->second.x, m_curr->second.y, m_curr->second.z);
501  else
502  {
503  Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z);
505  }
506 
507  /*
508  for (PlayerSet::iterator itr = m_passengers.begin(); itr != m_passengers.end();)
509  {
510  PlayerSet::iterator it2 = itr;
511  ++itr;
512  //(*it2)->SetPosition(m_curr->second.x + (*it2)->GetTransOffsetX(), m_curr->second.y + (*it2)->GetTransOffsetY(), m_curr->second.z + (*it2)->GetTransOffsetZ(), (*it2)->GetTransOffsetO());
513  }
514  */
515 
516  m_nextNodeTime = m_curr->first;
517 
518  #ifdef OREGON_DEBUG
519  if (m_curr == m_WayPoints.begin())
520  DEBUG_LOG(" ************ BEGIN ************** %s", this->m_name.c_str());
521 
522  DEBUG_LOG("%s moved to %d %f %f %f %d", this->m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid);
523  #endif
524 
525  //Transport Event System
526  CheckForEvent(this->GetEntry(), m_curr->second.id);
527  }
528 }
529 
530 void Transport::UpdateForMap(Map const* targetMap)
531 {
532  Map::PlayerList const& pl = targetMap->GetPlayers();
533  if (pl.isEmpty())
534  return;
535 
536  if (GetMapId() == targetMap->GetId())
537  {
538  for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
539  {
540  if (this != itr->GetSource()->GetTransport())
541  {
542  UpdateData transData;
543  BuildCreateUpdateBlockForPlayer(&transData, itr->GetSource());
544  WorldPacket packet;
545  transData.BuildPacket(&packet, true);
546  itr->GetSource()->SendDirectMessage(&packet);
547  }
548  }
549  }
550  else
551  {
552  UpdateData transData;
553  BuildOutOfRangeUpdateBlock(&transData);
554  WorldPacket out_packet;
555  transData.BuildPacket(&out_packet, true);
556 
557  for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
558  if (this != itr->GetSource()->GetTransport())
559  itr->GetSource()->SendDirectMessage(&out_packet);
560  }
561 }
562 
563 void Transport::DoEventIfAny(WayPointMap::value_type const& node, bool departure)
564 {
565  if (uint32 eventid = departure ? node.second.departureEventID : node.second.arrivalEventID)
566  {
567  DEBUG_LOG("Taxi %s event %u of node %u of %s (%s) path", departure ? "departure" : "arrival", eventid, node.first, GetName(), GetObjectGUID().GetString().c_str());
568  GetMap()->ScriptsStart(sEventScripts, eventid, this, this);
569  }
570 }
GameobjectTypes
bool BuildPacket(WorldPacket *packet, bool hasTransport=false)
Definition: UpdateData.cpp:103
virtual void ResetMap()
Definition: Object.cpp:1972
GameObjectInfo const * m_goInfo
Definition: GameObject.h:859
bool GenerateWaypoints(uint32 pathid, std::set< uint32 > &mapids)
Definition: Transports.cpp:191
ObjectGuid const & GetObjectGUID() const
Definition: Object.h:182
WayPointMap m_WayPoints
Definition: Transports.h:74
void ScriptsStart(std::map< uint32, std::multimap< uint32, ScriptInfo > > const &scripts, uint32 id, Object *source, Object *target)
Definition: MapScripts.cpp:33
Map * GetMap() const
Definition: Object.h:841
DatabaseType WorldDatabase
Accessor to the world database.
Definition: Main.cpp:53
void SetGoType(GameobjectTypes type)
Definition: GameObject.h:724
Definition: Field.h:24
void SetObjectScale(float scale)
Definition: Object.h:205
std::string m_name
Definition: Object.h:931
float tTo
Definition: Transports.cpp:188
virtual void SetMap(Map *map)
Definition: Object.cpp:1954
uint32 getMSTime()
Definition: Timer.h:32
#define sLog
Log class singleton.
Definition: Log.h:187
struct GameObjectInfo::@59::@74 moTransport
void Remove(const GameObjectModel &mdl)
Definition: Map.h:533
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:779
uint32 displayId
Definition: GameObject.h:40
QueryResult_AutoPtr Query(const char *sql)
Definition: Database.cpp:383
NULL Dbg ErrDB Arena Chat Char Map MMap false
Definition: Log.cpp:556
TaxiPathNodesByPath sTaxiPathNodesByPath
Definition: DBCStores.cpp:148
iterator begin()
Definition: MapRefManager.h:48
#define sObjectMgr
Definition: ObjectMgr.h:1285
TaxiPathNodeEntry const * node
Definition: Transports.cpp:183
float distUntilStop
Definition: Transports.cpp:186
PlayerSet m_passengers
Definition: Transports.h:71
float distFromPrev
Definition: Transports.cpp:187
uint32 GetId(void) const
Definition: Map.h:333
void _Create(uint32 guidlow, uint32 entry, HighGuid guidhigh)
Definition: Object.cpp:125
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options=0)
Definition: Player.cpp:1488
GameObjectModel * m_model
Definition: GameObject.h:863
float GetOrientation() const
Definition: Position.h:100
void Relocate(float x, float y)
Definition: Position.h:65
std::string GetCppString() const
Definition: Field.h:52
void Insert(const GameObjectModel &mdl)
Definition: Map.h:534
Definition: Path.h:32
void UpdateForMap(Map const *map)
Definition: Transports.cpp:530
bool Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress, uint32 dynflags)
Definition: Transports.cpp:130
WayPointMap::iterator GetNextWayPoint()
Definition: Transports.cpp:394
uint8 m_updateFlag
Definition: Object.h:427
void Update(uint32 p_time) override
Definition: Transports.cpp:475
bool AddPassenger(Player *passenger)
Definition: Transports.cpp:451
#define DEBUG_LOG(...)
Definition: Log.h:194
uint32 m_pathTime
Definition: Transports.h:68
void ResurrectPlayer(float restore_percent, bool applySickness=false)
Definition: Player.cpp:4151
void UpdateModelPosition()
TransportMap m_TransportsByMap
Definition: MapManager.h:130
uint32 GetMapId() const
Definition: Object.h:591
bool isEmpty() const
Definition: LinkedList.h:97
Definition: Map.h:266
void SetGoAnimProgress(uint32 animprogress)
Definition: GameObject.h:741
float distSinceStop
Definition: Transports.cpp:185
virtual void BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const
Definition: Object.cpp:148
const char * GetName() const
Definition: Object.h:704
void SetGoState(GOState state)
PlayerList const & GetPlayers() const
Definition: Map.h:491
void DoEventIfAny(WayPointMap::value_type const &node, bool departure)
Definition: Transports.cpp:563
void CheckForEvent(uint32 entry, uint32 wp_id)
Definition: Transports.cpp:468
bool isDead() const
Definition: Unit.h:1338
void LoadTransports()
Definition: Transports.cpp:26
WayPointMap::iterator m_curr
Definition: Transports.h:66
Map * CreateMap(uint32 mapId, const WorldObject *obj, uint32 loginInstanceId=0)
Definition: MapManager.cpp:125
keyFrame(TaxiPathNodeEntry const &_node)
Definition: Transports.cpp:178
ACE_Refcounted_Auto_Ptr< QueryResult, ACE_Null_Mutex > QueryResult_AutoPtr
Definition: QueryResult.h:113
ScriptMapMap sEventScripts
Definition: ObjectMgr.cpp:52
uint32 m_nextNodeTime
Definition: Transports.h:75
void SetDelayedAddModelToMap()
Definition: Transports.h:45
void TeleportTransport(uint32 newMapid, float x, float y, float z)
Definition: Transports.cpp:403
uint32 m_period
Definition: Transports.h:76
void SetName(const std::string &newname)
Definition: Object.h:708
uint32 flags
Definition: GameObject.h:44
bool Contains(const GameObjectModel &mdl) const
Definition: Map.h:535
#define ASSERT
Definition: Errors.h:29
uint32 m_timer
Definition: Transports.h:69
bool RemovePassenger(Player *passenger)
Definition: Transports.cpp:461
bool _delayedAddModel
Definition: Transports.h:84
TransportSet m_Transports
Definition: MapManager.h:127
WayPointMap::iterator m_next
Definition: Transports.h:67
uint32 GetEntry() const
Definition: Object.h:192
bool IsPositionValid() const
Definition: Position.cpp:40
bool HasFlag(uint16 index, uint32 flag) const
Definition: Object.h:305
ACE_UINT32 uint32
Definition: Define.h:71
static GameObjectModel * Create(const GameObject &go)
uint32 faction
Definition: GameObject.h:43
size_t size() const
Definition: Path.h:35
void BuildOutOfRangeUpdateBlock(UpdateData *data) const
Definition: Object.cpp:236
Definition: Player.h:922
iterator end()
Definition: MapRefManager.h:52