mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Fix finding peep on ride news items
Peep's current_* variables were offset by 1. Also fixed comparison between 32-bit and 16-bit ints.
This commit is contained in:
@@ -200,7 +200,7 @@ void news_item_get_subject_location(int type, int subject, int *x, int *y, int *
|
||||
*x = sprite->unknown.x;
|
||||
*y = sprite->unknown.y;
|
||||
*z = sprite->unknown.z;
|
||||
if (*x != SPRITE_LOCATION_NULL)
|
||||
if (*((uint16*)x) != SPRITE_LOCATION_NULL)
|
||||
break;
|
||||
|
||||
if (sprite->peep.state != 3 && sprite->peep.state != 7) {
|
||||
@@ -208,8 +208,10 @@ void news_item_get_subject_location(int type, int subject, int *x, int *y, int *
|
||||
break;
|
||||
}
|
||||
|
||||
// Find which ride peep is on
|
||||
ride = &(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[sprite->peep.current_ride]);
|
||||
if (ride->var_1D0 & 1) {
|
||||
// Check if there are trains on the track (first bit of var_1D0)
|
||||
if (!(ride->var_1D0 & 1)) {
|
||||
*x = SPRITE_LOCATION_NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -72,9 +72,11 @@ typedef struct {
|
||||
uint8 happiness; // 0x3A
|
||||
uint8 pad_03B[0x2D];
|
||||
uint8 current_ride; // 0x68
|
||||
uint8 current_train; // 0x6A
|
||||
uint8 current_car; // 0x6B
|
||||
uint8 pad_6C[0x30];
|
||||
uint8 pad_6a; // 0x6A Part of current_ride?
|
||||
uint8 current_train; // 0x6B
|
||||
uint8 current_car; // 0x6c
|
||||
uint8 current_seat; // 0x6d
|
||||
uint8 pad_6C[0x2e];
|
||||
uint32 id; // 0x9C
|
||||
uint8 pad_A0[0x10];
|
||||
rct_peep_thought thoughts[PEEP_MAX_THOUGHTS]; // 0xB0
|
||||
|
||||
@@ -185,7 +185,7 @@ static void window_game_bottom_toolbar_mouseup()
|
||||
|
||||
news_item_get_subject_location(newsItem->type, subject, &x, &y, &z);
|
||||
|
||||
if (x == SPRITE_LOCATION_NULL)
|
||||
if ((uint16)x == SPRITE_LOCATION_NULL)
|
||||
break;
|
||||
|
||||
if ((mainWindow = window_get_main()) != NULL)
|
||||
|
||||
Reference in New Issue
Block a user