Fix #7229: Exploding guests cheat gets rides stuck and freezes game

This commit is contained in:
deurklink 2018-03-12 10:23:46 +01:00 committed by Michael Steenbeek
parent c4f3643be1
commit e0c4f88295
4 changed files with 14 additions and 16 deletions

View file

@ -111,6 +111,7 @@
- Fix: [#7011] Swinging and bobsleigh cars going backwards swing in the wrong direction (original bug).
- Fix: [#7125] No entry signs not correctly handled in pathfinding.
- Fix: [#7223] Vehicle mass not correctly recalculated when using remove all guests cheat.
- Fix: [#7229] Exploding guests cheat causes rides to get stuck and freezes game.
- Fix: Infinite loop when removing scenery elements with >127 base height.
- Fix: Ghosting of transparent map elements when the viewport is moved in OpenGL mode.
- Fix: Clear IME buffer after committing composed text.

View file

@ -415,16 +415,6 @@ static void cheat_explode_guests()
rct_peep *peep;
FOR_ALL_GUESTS(sprite_index, peep) {
// To prevent blowing up peeps that will break
// ride vehicle logic.
if (peep->state == PEEP_STATE_ENTERING_RIDE ||
peep->state == PEEP_STATE_QUEUING_FRONT ||
peep->state == PEEP_STATE_LEAVING_RIDE ||
peep->state == PEEP_STATE_ON_RIDE ||
peep->state == PEEP_STATE_QUEUING) {
continue;
}
if (scenario_rand_max(6) == 0) {
peep->peep_flags |= PEEP_FLAGS_EXPLODE;
}

View file

@ -33,7 +33,7 @@
// This string specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "39"
#define NETWORK_STREAM_VERSION "40"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
static rct_peep* _pickup_peep = nullptr;

View file

@ -989,13 +989,20 @@ static void sub_68F41A(rct_peep * peep, sint32 index)
if (peep->peep_flags & PEEP_FLAGS_EXPLODE && peep->x != LOCATION_NULL)
{
audio_play_sound_at_location(SOUND_CRASH, peep->x, peep->y, peep->z);
if (peep->state == PEEP_STATE_WALKING || peep->state == PEEP_STATE_SITTING)
{
audio_play_sound_at_location(SOUND_CRASH, peep->x, peep->y, peep->z);
sprite_misc_explosion_cloud_create(peep->x, peep->y, peep->z + 16);
sprite_misc_explosion_flare_create(peep->x, peep->y, peep->z + 16);
sprite_misc_explosion_cloud_create(peep->x, peep->y, peep->z + 16);
sprite_misc_explosion_flare_create(peep->x, peep->y, peep->z + 16);
peep_remove(peep);
return;
peep_remove(peep);
return;
}
else
{
peep->peep_flags &= ~PEEP_FLAGS_EXPLODE;
}
}
if (peep->peep_flags & PEEP_FLAGS_HUNGER)