[Core/Taxi] Incorrect behavior at path end
I stumbled over this issue when working on a quest. http://www.wowhead.com/spell=46814 is related. When the flight is performed and the player reaches the last node from TaxiPathNode.dbc the flight ends and the player falls to the ground. Especially on this path the above mentioned node and the endnode 237 in TaxiNodes.dbc for this path have quite different coordinates which makes the problem quite obvious. Instead of falling to the ground the player is supposed to teleport to the coordinates of the endnode.
You can see this here at about 4:33 https://www.youtube.com/watch?v=XHi9Z15QE6Q. Keep an eye on the minimap and notice how the position changes at the moment the drake lands.
hash: d163c58258160b65a2d785ef552653fc2c8f5eb1
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
This problem has been around for ages, it happens when you fly from Auberdine to Teldrassil as well. When you get to the end your character is high in the air (almost double the height of an Elf) and drops to the ground.
Fine so we have even more evidence: https://www.youtube.com/watch?v=dJsYllA69BA It's a little hard to see with no ui visible. But at 1:29 there is a little teleport it seems. Not as obvious as in my video linked in the first comment but you can see it.
I think a fix should be quite simple. Something like a teleport to taxipath endnode in void Player::CleanupAfterTaxiFlight()
I leave this to a core dev, though. Shauren, probably.
It seems to me that the core isn't respecting the position in the DBC.
There are a few nodes where the taxi disappears before the end and your character rolls through the air to the last node. Then there are the ones where you're too high in the air... Finally there's the whole problem of not skipping the interim flightmasters on a multi-stop flight.
Taxis have been "broken" for a long time but at least they work well enough to get you from A to B.
I managed to get this to work properly with the following addition to FlightPathMovementGenerator::DoFinalize(Player* player) in WaypointMovementGenerator.cpp.
TaxiPathEntry const* entry = sTaxiPathStore.LookupEntry(player->m_taxi.GetCurrentTaxiPath());
if (entry)
{
TaxiNodesEntry const* lastPathNode = sTaxiNodesStore.LookupEntry(entry->to);
player->TeleportTo(lastPathNode->map_id, lastPathNode->x, lastPathNode->y, lastPathNode->z, player->GetOrientation());
}
Now the player finishes the flight standing at the end position without falling from the last waypoint.
Unfortunately this leads to another issue which has been mentioned before by @MrSmite : TC taxi flight implementation for multi-stop flights. I can't find the issue on the tracker. Maybe @MrSmite can help? At each interim flight master DoFinalize is called and this breaks the flight process. The flight isn't continued to the next flight master.
if (player->m_taxi.empty()) determines if the flight is finished or continued to another point.
Also, see HandleMoveSplineDoneOpcode in taxihandler: SendDoFlight(uint32 mountDisplayId, uint32 path, uint32 pathNode)
while (GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE) GetPlayer()->GetMotionMaster()->MovementExpired(false);
That calls DoFinalize.
@akrom23 You are right. I moved my code to the if block you mentioned and now the flight is continued as supposed when an interim flight master is appoached. I am not sure if the teleport works as intended. And I can't test it myself because my graficscard doesn't work properly. Maybe you can give it a try...
The best spot to test a single flight is taxinode 236 (Coldarra Keristrasza to Malygos). Just cast 46813 there. At the end of the flight you should be teleported 30-40y as shown in the video in my first post. A multi-stop flight can be taken at any location. I had the feeling that the teleport didn't work on those though.
@Shauren can you look at this? It's important for 6.x work, as in 6.x it's even worse. Also look at related #15490
Current behavior: Flight paths currently use taxinode.dbc to check if you can use a flight path in that area, then once you are onboard a flight path it will use taxipathnode.dbc until the end. Which is incorrect, if emulator only uses taxipathnode.dbc you will end up in the wrong position in the end, which is usually seen as you falling down to the ground once flight path is finished. Expected behavior: What is supposed to happen after you reach last id of a pathid at your final destination is that the server should read from taxinode.dbc and teleport you to the location stated inside of the .dbc. So if you take a flight from Westfall to Stormwind, you should end up at the position .go xyz -8840.56 489.7 109.61 0 after teleportation, which is stated by taxinode.dbc under the name "Stormwind, Elwynn".
Videos from vanilla displaying this: https://www.youtube.com/watch?v=0Rx3xCa51IU https://www.youtube.com/watch?v=jo-cfBB4BY8 This still exists on retail, so it's very easy to test. Steps to reproduce:
- Take flightpath from any place to Stormwind, notice that you spawn on different location than where you spawned on retail when flight is over.
(6a0a800