1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 11:52:40 +01:00

Merge pull request #473 from husho/patch-3

Fixed: mission is not restarting if player is in vehicle
This commit is contained in:
darkf 2018-05-21 17:03:58 -05:00 committed by GitHub
commit a8110de63e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,6 +173,14 @@ void PlayerController::restart() {
state->hospitalIslandOverride = 0;
state->policeIslandOverride = 0;
// If we are in vehicle get us out
auto* vehicle = character->getCurrentVehicle();
if (vehicle) {
auto seat = character->getCurrentSeat();
character->setCurrentVehicle(nullptr, seat);
vehicle->setOccupant(seat, nullptr);
}
// Clear whole world
// Original game uses 4000.f radius
world->clearObjectsWithinArea(character->getPosition(), 10000.f, true);