Skip to content

Commit

Permalink
Proceed with movement vehicle fix
Browse files Browse the repository at this point in the history
If you try to move a vehicle which isn't on the map,
ProceedWithMovement will not wait for this to complete.
Instead the movement stays queued forever until you enter
the same map as the vehicle.

This also works if you use SetVehicleLocation() after the
move command to put the vehicle on the same map as you.

Once the vehicle is on the same map as the player, the movement
will immediately execute.

Fixes an issue where the game would hang in HH3 when
ProceedWithMovement was used.

To see the bug before this commit, setup the following event code

```
Move Vehicle Airship: Up
ProceedWithMovement
Teleport to map with airship
```

In RPG_RT you'll teleport, and then upon arriving the airship
will move. In player the game will hang.
  • Loading branch information
fmatthew5876 committed Dec 19, 2018
1 parent 28e4222 commit 10ebac7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/game_map.cpp
Expand Up @@ -1312,10 +1312,11 @@ bool Game_Map::IsAnyEventStarting() {
}

bool Game_Map::IsAnyMovePending() {
std::vector<Game_Character*>::iterator it;
for (it = pending.begin(); it != pending.end(); ++it)
if (!(*it)->IsMoveRouteRepeated())
for (auto& ev: pending) {
if (ev->GetMapId() == GetMapId() && ev->IsMoveRouteRepeated()) {
return true;
}
}

return false;
}
Expand Down

0 comments on commit 10ebac7

Please sign in to comment.