mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #4714. Prevent invalid peep access on closed golf rides.
When a golf ride is closed it will remove the peep from the vehicle (the ball). Due to the way vehicles leave stations the vehicle would still travel to the next hole but when it tried to update the peeps action it would crash. This skips updating the peeps action but lets the ball still continue. This will cause a phantom ball to go around the golf course until all the vehicles are back in their closed state.
This commit is contained in:
parent
4662b648d2
commit
2f6f728200
|
@ -8139,16 +8139,21 @@ loc_6DC743:
|
||||||
break;
|
break;
|
||||||
case 4: // loc_6DC820
|
case 4: // loc_6DC820
|
||||||
z = moveInfo->z;
|
z = moveInfo->z;
|
||||||
if (z == 2) {
|
// When the ride is closed occasionally the peep is removed
|
||||||
rct_peep *peep = GET_PEEP(vehicle->peep[0]);
|
// but the vehicle is still on the track. This will prevent
|
||||||
if (peep->id & 7) {
|
// it from crashing in that situation.
|
||||||
z = 7;
|
if (vehicle->peep[0]) {
|
||||||
|
if (z == 2) {
|
||||||
|
rct_peep *peep = GET_PEEP(vehicle->peep[0]);
|
||||||
|
if (peep->id & 7) {
|
||||||
|
z = 7;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if (z == 6) {
|
||||||
if (z == 6) {
|
rct_peep *peep = GET_PEEP(vehicle->peep[0]);
|
||||||
rct_peep *peep = GET_PEEP(vehicle->peep[0]);
|
if (peep->id & 7) {
|
||||||
if (peep->id & 7) {
|
z = 8;
|
||||||
z = 8;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
vehicle->mini_golf_current_animation = (uint8)z;
|
vehicle->mini_golf_current_animation = (uint8)z;
|
||||||
|
|
Loading…
Reference in New Issue