Core/Transports:

* stoppable transports will now have a default stop frame starting at 0
* fixed stoppable transport movement visuals
* fixed travel time calculation for transports that return to stop frame 0
This commit is contained in:
Ovahlord
2018-06-11 12:01:20 +02:00
parent 6b49893d17
commit a938aa208c

View File

@@ -298,6 +298,8 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
m_goValue.Transport.CurrentSeg = 0;
m_goValue.Transport.StateUpdateTimer = 0;
m_goValue.Transport.StopFrames = new std::vector<uint32>();
m_goValue.Transport.StopFrames->push_back(0); // assign default stop frame
if (goinfo->transport.stopFrame1 > 0)
m_goValue.Transport.StopFrames->push_back(goinfo->transport.stopFrame1);
if (goinfo->transport.stopFrame2 > 0)
@@ -2237,9 +2239,15 @@ void GameObject::SetTransportState(GOState state, uint32 stopFrame /*= 0*/)
{
ASSERT(state < GOState(GO_STATE_TRANSPORT_STOPPED + MAX_GO_STATE_TRANSPORT_STOP_FRAMES));
ASSERT(stopFrame < m_goValue.Transport.StopFrames->size());
m_goValue.Transport.PathProgress = getMSTime() + m_goValue.Transport.StopFrames->at(stopFrame);
// If we return to stop frame 0 we are going to use the passed transport travel time to get back
uint32 stopFrameTime = stopFrame ? m_goValue.Transport.StopFrames->at(stopFrame) : m_goValue.Transport.PathProgress;
m_goValue.Transport.PathProgress = getMSTime() + stopFrameTime;
SetGoState(GOState(GO_STATE_TRANSPORT_STOPPED + stopFrame));
}
ForceValuesUpdateAtIndex(GAMEOBJECT_LEVEL);
ForceValuesUpdateAtIndex(GAMEOBJECT_BYTES_1);
}
void GameObject::SetDisplayId(uint32 displayid)