Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Make sure units move to/stay on the appropriate movement layer after stopping #15949
Units given stop command on a high-bridge, which below the bridge is also passable by the unit, get a move command to below the bridge, they no longer phase thru them but still (try to) move there. Same doesn't happen for Tunnel because move command is ignored.
I revisited this and found IMO a simpler way to handle this. Instead of shortening the movement path, this makes the unit stop then immediately gives it an order to leave the tunnel in OnBecomingIdle.
The tunnel exit Location is found in EntersTunnels.CustomLayerChanged. This searches for the closest tunnel entrance and retrieves the exit from that. I'm not sure if this is the best way to find the exit but this was what I came up with.