Implement pathing on elevators and improve extractors. (#1206)

* Implement GAMEOBJECT_TYPE_TRANSPORT serverside position simulation

https://github.com/cmangos/mangos-classic/commit/a0a9ebfb641146d347c10d2bd6348c560914d2ed

* Implement Boarding and Unboarding for GO type 11 TRANSPORT

https://github.com/cmangos/mangos-classic/commit/3b3ff84751f264a06b1ed92c5d439c756404e8af

* Fix issues with boats.

* Rename DARK_WATER to DEEP_WATER.

Cherry picked from https://github.com/cmangos/mangos-classic/commit/bf00a047bed5fdf736f3308a1d8b2947ac11a3c3

* Mmap generation improvements

https://github.com/cmangos/mangos-classic/commit/ee121a78542f28acfe152a89c8f4e9e8cb28ef50

* Replace use of 'new' with CreateGameObject.

* Implement Gameobject model mmap extraction and loading

https://github.com/cmangos/mangos-classic/commit/91291db3928feff80fa9066f65dea08ec551169a

* MMAP: Add mmap extractor option to only extract GO models

https://github.com/cmangos/mangos-classic/commit/add3e1f6e5b9cfa67454eaf1367c65f6ae032917

* Rename a few local variables in buildGameObject to match cmangos.

https://github.com/cmangos/mangos-classic/commit/ac98ef2cc9ee52ba425af35fe15c20f46686dd5c

* Implement support for transport pathfinding and teleporting onto transport

https://github.com/cmangos/mangos-classic/commit/d6bb14ce3dd394ee0b6d5c08e034c35775e8e63e

* MMap: Adjust default parameters in favor of proper extraction of gameobjects

https://github.com/cmangos/mangos-classic/commit/15ba386aac01ccac95c40d5a196ecd1e5b595ac8

* MMap: Add building of all transports

https://github.com/cmangos/mangos-classic/commit/99fcbe1a58ee61ac3a1904cd1cb015a7c0e86ab4

* Transport: Make movementInfo pos and tpos reference

https://github.com/cmangos/mangos-classic/commit/ff0df5e811f7f1ad5753778b94d5b6b0ca6d047d

* Transport: Add readout to HandleGPSCommand for transport pos

https://github.com/cmangos/mangos-classic/commit/c2cb0050f412b174cf2d359c47b086b1f6c7bf6d

* Transport/Object: Minor refactor of position fetching for UPDATEFLAG_HAS_POSITION

https://github.com/cmangos/mangos-classic/commit/f758a22f39bbf46af8b4a2d2514fa99c09e37b75

* Transport/MMAP: Add help output for new --onlyGO switch

https://github.com/cmangos/mangos-classic/commit/0f8a8d1bd8ad03ba9285499118c77b2589d5b85b

* Increase visibility range of transports.

* Do not use UPDATEFLAG_TRANSPORT for corpses

https://github.com/cmangos/mangos-classic/commit/018bccf6ca43338d098ae8b996c26bc867c784ec

* Transport: Fix order and sign of transport type 11 coordinates

https://github.com/cmangos/mangos-classic/commit/f8002fe061811805fc3f6f27087481be9e834759

* Transports: Remove redundant if (GetGoState() == GO_STATE_READY) block in TBC

https://github.com/cmangos/mangos-classic/commit/36c8c2dfd380b331667cee463e04d8f7747f7266

* Transports: Fix orientation of GO type 11 in vanilla and tbc using proper quat computation

https://github.com/cmangos/mangos-classic/commit/08004564acaeee6e20e76180a1073c4eb1f17c20

* Vmap: Search upward for finding height if below is nothing

https://github.com/cmangos/mangos-classic/commit/c124b3eb8579ae2dcbf1d8ab30ee5249701fad9e

* MapExtraction: Fix water height redundancy algorithm ignoring no water

https://github.com/cmangos/mangos-classic/commit/9b39a41774b145bcb1e5a49038a030f6739d91a9

* VMAP: Replace string* with vector of strings

https://github.com/cmangos/mangos-classic/commit/884452ef54cc265d326dc56e6cef3994794c3db

* Vmap: Port MOPY flag usage from TC and introduce back mogpflag usage for lighting groups

https://github.com/cmangos/mangos-classic/commit/0666136d0d6cc6843fad1eb4286aee83df1dea01

* Vmap: Introduce skipping of antiportals

https://github.com/cmangos/mangos-classic/commit/2cee1027baeebef3646b2645ec95d8d079e6da89

* Transports: Also print orientation in gps command

https://github.com/cmangos/mangos-classic/commit/6effe3f0786bf1d67a722f7379cc533083247475

* Mmap: Do not register and extract GO displayid 462 and 562

https://github.com/cmangos/mangos-classic/commit/328ef02c05a36867772c08f3cb3d8de116719619

* Increase map version.

* Fix version check.

Co-authored-by: Killerwife <killerwife@gmail.com>
Co-authored-by: Laizerox <dpetmanson@gmail.com>
This commit is contained in:
ratkosrb
2021-06-01 19:18:40 +03:00
committed by GitHub
parent 2368e0470c
commit 39afde5307
57 changed files with 23857 additions and 504 deletions
+28 -20
View File
@@ -57,7 +57,7 @@
void MovementInfo::Read(ByteBuffer &data)
{
time = WorldTimer::getMSTime();
stime = WorldTimer::getMSTime();
data >> moveFlags;
data >> ctime;
data >> pos.x;
@@ -140,7 +140,7 @@ void MovementInfo::CorrectData(Unit* mover)
void MovementInfo::Write(ByteBuffer &data) const
{
data << moveFlags;
data << time;
data << stime;
data << pos.x;
data << pos.y;
data << pos.z;
@@ -432,7 +432,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint8 updateFlags) const
MovementInfo m = wobject->m_movementInfo;
if (!m.ctime)
{
m.time = WorldTimer::getMSTime() + 1000;
m.stime = WorldTimer::getMSTime() + 1000;
m.ChangePosition(wobject->GetPositionX(), wobject->GetPositionY(), wobject->GetPositionZ(), wobject->GetOrientation());
}
if (unit->ToCreature())
@@ -459,12 +459,23 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint8 updateFlags) const
{
if (updateFlags & UPDATEFLAG_HAS_POSITION) // 0x40
{
WorldObject* object = ((WorldObject*)this);
*data << float(object->GetPositionX());
*data << float(object->GetPositionY());
*data << float(object->GetPositionZ());
*data << float(object->GetOrientation());
// 0x02
if (updateFlags & UPDATEFLAG_TRANSPORT)
{
GameObject const* go = static_cast<GameObject const*>(this);
*data << float(go->GetStationaryX());
*data << float(go->GetStationaryY());
*data << float(go->GetStationaryZ());
*data << float(go->GetStationaryO());
}
else
{
WorldObject const* wo = static_cast<WorldObject const*>(this);
*data << float(wo->GetPositionX());
*data << float(wo->GetPositionY());
*data << float(wo->GetPositionZ());
*data << float(wo->GetOrientation());
}
}
}
if (updateFlags & UPDATEFLAG_HIGHGUID)
@@ -501,10 +512,10 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint8 updateFlags) const
this causes clients to receive different PathProgress
resulting in players seeing the object in a different position
*/
if (go && go->ToTransport())
if (go && go->IsMoTransport())
*data << uint32(go->ToTransport()->GetPathProgress());
else
*data << uint32(WorldTimer::getMSTime());
*data << uint32(sWorld.GetCurrentMSTime());
}
#else
Unit const* unit = ToUnit();
@@ -1385,20 +1396,17 @@ void WorldObject::SetVisibilityModifier(float f)
WorldObject::WorldObject()
: m_isActiveObject(false), m_visibilityModifier(DEFAULT_VISIBILITY_MODIFIER), m_currMap(nullptr),
m_mapId(0), m_InstanceId(0), m_summonLimitAlert(0)
m_mapId(0), m_InstanceId(0), m_summonLimitAlert(0), worldMask(WORLD_DEFAULT_OBJECT), m_zoneScript(nullptr),
m_transport(nullptr)
{
// Phasing
worldMask = WORLD_DEFAULT_OBJECT;
m_zoneScript = nullptr;
m_transport = nullptr;
m_movementInfo.time = WorldTimer::getMSTime();
m_movementInfo.stime = WorldTimer::getMSTime();
}
void WorldObject::CleanupsBeforeDelete()
{
RemoveFromWorld();
if (Transport* transport = GetTransport())
if (GenericTransport* transport = GetTransport())
transport->RemovePassenger(this);
}
@@ -2335,7 +2343,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
return nullptr;
}
Map* map = GetMap();
GameObject* go = new GameObject();
GameObject* go = GameObject::CreateGameObject(entry);
if (!go->Create(map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, map, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY))
{
delete go;
@@ -3220,7 +3228,7 @@ void WorldObject::MonsterWhisper(int32 textId, Unit const* target, bool IsBossWh
((Player*)target)->GetSession()->SendPacket(&data);
}
void WorldObject::GetPosition(float &x, float &y, float &z, Transport* t) const
void WorldObject::GetPosition(float &x, float &y, float &z, GenericTransport* t) const
{
if (t && m_movementInfo.t_guid == t->GetObjectGuid())
{