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

+28 -7
View File
@@ -58,6 +58,7 @@
#include "SpellMgr.h"
#include "TemporarySummon.h"
#include "Totem.h"
#include "Transport.h"
#include "Unit.h"
#include "UpdateMask.h"
#include "Util.h"
@@ -3166,7 +3167,11 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
uint32 gameobject_id = m_spellInfo->Effects[effIndex].MiscValue;
GameObject* pGameObj = new GameObject;
GameObject* pGameObj = nullptr;
if (sObjectMgr->GetGameObjectTypeByEntry(gameobject_id) == GAMEOBJECT_TYPE_TRANSPORT)
pGameObj = new Transport();
else
pGameObj = new GameObject();
WorldObject* target = focusObject;
if (!target)
@@ -4144,7 +4149,11 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex)
m_caster->m_ObjectSlot[slot].Clear();
}
GameObject* go = new GameObject();
GameObject* go = nullptr;
if (sObjectMgr->GetGameObjectTypeByEntry(go_id) == GAMEOBJECT_TYPE_TRANSPORT)
go = new Transport();
else
go = new GameObject();
float x, y, z;
// If dest location if present
@@ -4870,12 +4879,24 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
QuaternionData rot = QuaternionData::fromEulerAnglesZYX(fo, 0.f, 0.f);
GameObject* pGameObj = new GameObject;
if (!pGameObj->Create(cMap->GenerateLowGuid<HighGuid::GameObject>(), name_id, cMap, 0, Position(fx, fy, fz, m_caster->GetOrientation()), rot, 255, GO_STATE_READY))
GameObject* pGameObj = nullptr;
if (goinfo->type == GAMEOBJECT_TYPE_TRANSPORT)
{
delete pGameObj;
return;
pGameObj = new Transport();
if (!pGameObj->Create(cMap->GenerateLowGuid<HighGuid::Transport>(), name_id, cMap, 0, Position(fx, fy, fz, m_caster->GetOrientation()), rot, 255, GO_STATE_READY))
{
delete pGameObj;
return;
}
}
else
{
pGameObj = new GameObject();
if (!pGameObj->Create(cMap->GenerateLowGuid<HighGuid::GameObject>(), name_id, cMap, 0, Position(fx, fy, fz, m_caster->GetOrientation()), rot, 255, GO_STATE_READY))
{
delete pGameObj;
return;
}
}
PhasingHandler::InheritPhaseShift(pGameObj, m_caster);