1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 12:03:07 +01:00

Decompiled PEEP_STATE_QUEUING

This commit is contained in:
Duncan Frost
2014-09-16 20:51:07 +01:00
parent 0e223c524e
commit 0624736b47
3 changed files with 105 additions and 6 deletions

View File

@@ -175,9 +175,107 @@ static void peep_update(rct_peep *peep)
RCT2_CALLPROC_X(0x0068FD3A, 0, 0, 0, 0, (int)peep, 0, 0);
} else {
// loc_68FD2F
RCT2_CALLPROC_X(0x0068FD2F, 0, 0, 0, 0, (int)peep, 0, 0);
switch (peep->state) {
switch (peep->state) {
case PEEP_STATE_QUEUING:
//69185d
if (RCT2_CALLPROC_X(0x68F3AE, 0, 0, 0, 0, (int)peep, 0, 0) & 0x40){
RCT2_CALLPROC_X(0x691A23, 0, 0, 0, 0, (int)peep, 0, 0);
return;
}
rct_ride* ride = GET_RIDE(peep->current_ride);
if (ride->status == RIDE_STATUS_CLOSED || ride->status == RIDE_STATUS_TESTING){
//6918b9
RCT2_CALLPROC_X(0x6966A9, 0, 0, 0, 0, (int)peep, 0, 0);
RCT2_CALLPROC_X(0x69A409, 0, 0, 0, 0, (int)peep, 0, 0);
peep->state = 1;
RCT2_CALLPROC_X(0x69A42F, 0, 0, 0, 0, (int)peep, 0, 0);
return;
}
if (peep->var_2C != 0xA){
if (peep->var_74 == 0xFFFF){
//Happens every time peep goes onto ride.
peep->var_36 = 0;
RCT2_CALLPROC_X(0x69A409, 0, 0, 0, 0, (int)peep, 0, 0);
peep->state = PEEP_STATE_QUEUING_FRONT;
RCT2_CALLPROC_X(0x69A42F, 0, 0, 0, 0, (int)peep, 0, 0);
peep->var_2C = 0;
return;
}
peep->sprite_direction ^= (1 << 4);
RCT2_CALLPROC_X(0x6EC473, 0, 0, 0, 0, (int)peep, 0, 0);
RCT2_CALLPROC_X(0x6966A9, 0, 0, 0, 0, (int)peep, 0, 0);
RCT2_CALLPROC_X(0x69A409, 0, 0, 0, 0, (int)peep, 0, 0);
peep->state = 1;
RCT2_CALLPROC_X(0x69A42F, 0, 0, 0, 0, (int)peep, 0, 0);
}
//6918CD
RCT2_CALLPROC_X(0x693C9E, 0, 0, 0, 0, (int)peep, 0, 0);
if (peep->var_71 < 0xFE)return;
if (peep->sprite_type == 0){
//6919A8
if (peep->var_7A >= 2000 && (0xFFFF & scenario_rand()) <= 119){
peep->var_71 = 1;
peep->var_72 = 0;
peep->var_70 = 0;
RCT2_CALLPROC_X(0x693B58, 0, 0, 0, 0, (int)peep, 0, 0);
RCT2_CALLPROC_X(0x6EC473, 0, 0, 0, 0, (int)peep, 0, 0);
}
if (peep->var_7A >= 3500 && (0xFFFF & scenario_rand()) <= 93)
{
//Create the ive been waiting in line ages thought
RCT2_CALLPROC_X(0x699F5A, (peep->current_ride << 8) | PEEP_THOUGHT_TYPE_QUEUING_AGES, 0, 0, 0, (int)peep, 0, 0);
}
}
else{
if (!(peep->var_7A & 0x3F) && peep->var_71 == 0xFE && peep->var_6F == 2){
switch (peep->sprite_type){
case 0xF:
case 0x10:
case 0x11:
case 0x12:
case 0x14:
case 0x16:
case 0x18:
case 0x1F:
case 0x20:
case 0x21:
case 0x22:
case 0x23:
case 0x24:
case 0x25:
case 0x27:
case 0x29:
case 0x2A:
case 0x2B:
case 0x2C:
case 0x2D:
case 0x2E:
case 0x2F:
peep->var_71 = 1;
peep->var_72 = 0;
peep->var_70 = 0;
RCT2_CALLPROC_X(0x693B58, 0, 0, 0, 0, (int)peep, 0, 0);
RCT2_CALLPROC_X(0x6EC473, 0, 0, 0, 0, (int)peep, 0, 0);
break;
}
}
}
if (peep->var_7A < 4300) return;
if (peep->happiness <= 65 && (0xFFFF & scenario_rand()) < 2184){
peep->sprite_direction ^= (1 << 4);
RCT2_CALLPROC_X(0x6EC473, 0, 0, 0, 0, (int)peep, 0, 0);
RCT2_CALLPROC_X(0x6966A9, 0, 0, 0, 0, (int)peep, 0, 0);
RCT2_CALLPROC_X(0x69A409, 0, 0, 0, 0, (int)peep, 0, 0);
peep->state = 1;
RCT2_CALLPROC_X(0x69A42F, 0, 0, 0, 0, (int)peep, 0, 0);
}
break;
default:
RCT2_CALLPROC_X(0x0068FD2F, 0, 0, 0, 0, (int)peep, 0, 0);
break;
}
}
}

View File

@@ -371,16 +371,17 @@ typedef struct {
uint8 current_seat; // 0x6C
uint8 var_6D; // 0x6D
uint8 var_6E; // 0x6E
uint8 pad_6F;
uint8 var_6F;
uint8 var_70;
uint8 var_71;
uint8 var_72;
uint8 var_73;
uint16 pad_74;
uint16 var_74;
uint8 var_76;
uint8 pad_77;
uint8 var_78;
uint8 pad_79[0x03];
uint8 pad_79;
uint16 var_7A; // time waiting in line possibly
uint8 rides_been_on[32]; // 0x7C
// 255 bit bitmap of every ride the peep has been on see
// window_peep_rides_update for how to use.

View File

@@ -1098,7 +1098,7 @@ void window_guest_overview_update(rct_window* w){
int rand = scenario_rand() & 0xFFFF;
if (rand <= 0x2AAA){
rct_peep* peep = GET_PEEP(w->number);
RCT2_CALLPROC_X(0x699F5A, 0xFF47, 0, 0, 0, (int)peep, 0, 0);
RCT2_CALLPROC_X(0x699F5A, 0xFF00 | PEEP_THOUGHT_TYPE_WATCHED, 0, 0, 0, (int)peep, 0, 0);
}
}
}