Core/Transports: ported transport refactoring

* this implements full support for stoppable transports as well as serverside transport position tracking
* fixed several vehicle related issues
* fixed gameobject passengers not being displayed as transport passengers
* pets, dynamic objects and other summons are not added as transport passengers and will now properly be displayed
Todo:
- Deeprun Tram visual issues needs to be resolved
- Lady Deathwhisper's elevator needs some additional research
This commit is contained in:
Ovahlord committed 2018-11-21 12:04:26 +01:00
1 parent d8bf3a3170
commit 5229a734dd
49 files changed
+1381 -602

No files matched your search

+17 -3
View File
@@ -37,6 +37,7 @@ EndScriptData */
#include "Player.h"
#include "PoolMgr.h"
#include "RBAC.h"
#include "Transport.h"
#include "WorldSession.h"
// definitions are over in cs_npc.cpp
@@ -151,8 +152,18 @@ public:
Player* player = handler->GetSession()->GetPlayer();
Map* map = player->GetMap();
GameObject* object = new GameObject;
ObjectGuid::LowType guidLow = map->GenerateLowGuid<HighGuid::GameObject>();
GameObject* object = nullptr;
ObjectGuid::LowType guidLow = ObjectGuid::Empty;
if (objectInfo->type == GAMEOBJECT_TYPE_TRANSPORT)
{
object = new Transport();
ObjectGuid::LowType guidLow = map->GenerateLowGuid<HighGuid::Transport>();
}
else
{
object = new GameObject();
ObjectGuid::LowType guidLow = map->GenerateLowGuid<HighGuid::GameObject>();
}
if (!object->Create(guidLow, objectInfo->entry, map, 0, *player, QuaternionData(), 255, GO_STATE_READY))
{
@@ -176,7 +187,10 @@ public:
// this is required to avoid weird behavior and memory leaks
delete object;
object = new GameObject();
if (objectInfo->type == GAMEOBJECT_TYPE_TRANSPORT)
object = new Transport();
else
object = new GameObject();
// this will generate a new guid if the object is in an instance
if (!object->LoadFromDB(guidLow, map, true))
{