Don't crash when fixing a hacked ride

This commit is contained in:
Michał Janiszewski 2016-03-23 16:10:55 +01:00
parent 74d96d86c0
commit c33b8ccdc5
1 changed files with 3 additions and 0 deletions

View File

@ -3757,6 +3757,9 @@ static bool peep_update_fixing_sub_state_9(bool firstRun, rct_peep *peep, rct_ri
input.x = (stationPosition & 0xFF) * 32;
input.y = (stationPosition >> 8) * 32;
input.element = map_get_track_element_at_from_ride(input.x, input.y, stationZ, peep->current_ride);
if (input.element == NULL) {
return true;
}
track_begin_end trackBeginEnd;
while (track_block_get_previous(input.x, input.y, input.element, &trackBeginEnd)) {