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

@@ -27,6 +27,7 @@
#include "GameObject.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Transport.h"
#include "World.h"
#include "ScriptMgr.h"
@@ -166,6 +167,48 @@ void LoadHelper(CellGuidSet const& guid_set, CellCoord &cell, GridRefManager<T>
}
}
template <>
void LoadHelper(CellGuidSet const& guid_set, CellCoord &cell, GridRefManager<GameObject> &m, uint32 &count, Map* map)
{
for (CellGuidSet::const_iterator i_guid = guid_set.begin(); i_guid != guid_set.end(); ++i_guid)
{
uint32 guid = *i_guid;
GameObjectData const* data = sObjectMgr->GetGameObjectData(guid);
GameObject* obj = nullptr;
if (data && sObjectMgr->GetGameObjectTypeByEntry(data->id) == GAMEOBJECT_TYPE_TRANSPORT)
obj = new Transport();
else
obj = new GameObject();
// Don't spawn at all if there's a respawn time
if (obj->GetTypeId() == TYPEID_GAMEOBJECT && !map->GetGORespawnTime(*i_guid))
{
ObjectGuid::LowType guid = *i_guid;
if (obj->GetTypeId() == TYPEID_GAMEOBJECT)
{
// If gameobject in manual spawn group, don't spawn here, unless group is already active.
GameObjectData const* godata = sObjectMgr->GetGameObjectData(guid);
ASSERT(godata, "Tried to load gameobject with spawnId %u, but no such object exists.", guid);
if (!(godata->spawnGroupData->flags & SPAWNGROUP_FLAG_SYSTEM))
if (!map->IsSpawnGroupActive(godata->spawnGroupData->groupId))
{
delete obj;
continue;
}
}
}
if (!obj->LoadFromDB(guid, map, false, false))
{
delete obj;
continue;
}
AddObjectHelper(cell, m, count, map, obj);
}
}
void ObjectGridLoader::Visit(GameObjectMapType &m)
{
CellCoord cellCoord = i_cell.GetCellCoord();