Skip to content

Commit

Permalink
Fix #5912: Negative queue when moving entrance in paused state. (#6060)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZehMatt authored and IntelOrca committed Jul 29, 2017
1 parent d23de89 commit d23e6fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions distribution/changelog.txt
Expand Up @@ -12,6 +12,7 @@
- Fix: [#5858] Crash when using custom ride with no colour presets.
- Fix: [#5872] Incorrect OpenGL rendering of masked sprites
- Fix: [#5880] Leaving bumper cars without building causes assertion.
- Fix: [#5912] Negative queue when moving entrance in paused state.
- Fix: [#5920] Placing guest spawn doesn't do anything every 3rd click
- Fix: [#5939] Crash when importing 'Six Flags Santa Fe'.
- Fix: [#5977] Custom music files not showing up in music list
Expand Down
8 changes: 7 additions & 1 deletion src/openrct2/peep/peep.c
Expand Up @@ -2317,7 +2317,13 @@ void remove_peep_from_queue(rct_peep* peep)
rct_ride* ride = get_ride(peep->current_ride);

uint8 cur_station = peep->current_ride_station;
ride->queue_length[cur_station]--;
// Make sure we don't underflow, building while paused might reset it to 0 where peeps have
// not yet left the queue.
if (ride->queue_length[cur_station] > 0)
{
ride->queue_length[cur_station]--;
}

if (peep->sprite_index == ride->last_peep_in_queue[cur_station])
{
ride->last_peep_in_queue[cur_station] = peep->next_in_queue;
Expand Down

0 comments on commit d23e6fe

Please sign in to comment.