1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 09:32:29 +01:00

Fix infinite peep money bug caused by forgetting previous ride.

This commit is contained in:
Duncan Frost
2015-01-16 11:55:14 +00:00
parent b10f85f4ea
commit aaba78c81f
2 changed files with 13 additions and 12 deletions

View File

@@ -1338,8 +1338,8 @@ static void peep_update_buying(rct_peep* peep)
} }
if (ride->type == RIDE_TYPE_ATM){ if (ride->type == RIDE_TYPE_ATM){
if (peep->current_ride != peep->var_AD){ if (peep->current_ride != peep->previous_ride){
peep->cash_in_pocket += 500; peep->cash_in_pocket += MONEY(50,00);
} }
window_invalidate_by_number(WC_PEEP, peep->sprite_index); window_invalidate_by_number(WC_PEEP, peep->sprite_index);
} }
@@ -1356,16 +1356,16 @@ static void peep_update_buying(rct_peep* peep)
uint8 item_bought = 0; uint8 item_bought = 0;
if (peep->current_ride != peep->var_AD){ if (peep->current_ride != peep->previous_ride){
if (ride->type == RIDE_TYPE_ATM){ if (ride->type == RIDE_TYPE_ATM){
item_bought = !(RCT2_CALLPROC_X(0x0069AEB7, peep->current_ride << 8, 0, 0, 0, (int)peep, 0, 0) & 0x100); item_bought = !(RCT2_CALLPROC_X(0x0069AEB7, peep->current_ride << 8, 0, 0, 0, (int)peep, 0, 0) & 0x100);
if (!item_bought){ if (!item_bought){
peep->var_AD = peep->current_ride; peep->previous_ride = peep->current_ride;
peep->var_AE = 0; peep->previous_ride_time_out = 0;
} }
else{ else{
peep->action = PEEP_ACTION_30; peep->action = PEEP_ACTION_WITHDRAW_MONEY;
peep->action_frame = 0; peep->action_frame = 0;
peep->var_70 = 0; peep->var_70 = 0;
@@ -1411,6 +1411,7 @@ static void peep_update_buying(rct_peep* peep)
peep->sub_state = 1; peep->sub_state = 1;
return; return;
} }
/* rct2: 0x0069030A */ /* rct2: 0x0069030A */
static void peep_update_walking(rct_peep* peep){ static void peep_update_walking(rct_peep* peep){
//RCT2_CALLPROC_X(0x0069030A, 0, 0, 0, 0, (int)peep, 0, 0); //RCT2_CALLPROC_X(0x0069030A, 0, 0, 0, 0, (int)peep, 0, 0);
@@ -1711,9 +1712,9 @@ static void peep_update(rct_peep *peep)
//return; //return;
if (peep->type == PEEP_TYPE_GUEST) { if (peep->type == PEEP_TYPE_GUEST) {
if (peep->var_AD != 255) if (peep->previous_ride != 255)
if (++peep->var_AE < 720) if (++peep->previous_ride_time_out >= 720)
peep->var_AD = 255; peep->previous_ride = 255;
peep_update_thoughts(peep); peep_update_thoughts(peep);
} }

View File

@@ -236,7 +236,7 @@ enum PEEP_ACTION_EVENTS {
PEEP_ACTION_DRAW_PICTURE = 28, PEEP_ACTION_DRAW_PICTURE = 28,
PEEP_ACTION_30 = 30, PEEP_ACTION_WITHDRAW_MONEY = 30,
PEEP_ACTION_NONE_1 = 254, PEEP_ACTION_NONE_1 = 254,
PEEP_ACTION_NONE_2 = 255 PEEP_ACTION_NONE_2 = 255
@@ -436,8 +436,8 @@ typedef struct {
money32 cash_spent; // 0xA4 money32 cash_spent; // 0xA4
sint32 time_in_park; // 0xA8 sint32 time_in_park; // 0xA8
uint8 var_AC; // 0xAC uint8 var_AC; // 0xAC
uint8 var_AD; // 0xAD uint8 previous_ride; // 0xAD
uint16 var_AE; uint16 previous_ride_time_out; // 0xAE
rct_peep_thought thoughts[PEEP_MAX_THOUGHTS]; // 0xB0 rct_peep_thought thoughts[PEEP_MAX_THOUGHTS]; // 0xB0
uint8 var_C4; // 0xC4 uint8 var_C4; // 0xC4
union // 0xC5 union // 0xC5