1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Decompiled function 0x006AF561

This commit is contained in:
zsilencer
2014-08-23 02:44:06 -06:00
parent 0992a6adcd
commit 84d4747a60
3 changed files with 52 additions and 7 deletions

View File

@@ -103,10 +103,13 @@ typedef struct {
uint8 pad_14E[0x06];
uint32 var_154;
uint16 var_158;
uint8 pad_15A[0x26];
uint8 pad_15A;
uint8 num_riders; // 0x15B
uint8 pad_15C[0x24];
uint16 build_date;
sint16 upkeep_cost; // 0x182
uint8 pad_184[0x12];
uint16 race_winner; // 0x184
uint8 pad_186[0x10];
uint16 var_196;
// used in computing excitement, nausea, etc
uint8 var_198;

View File

@@ -134,6 +134,8 @@ enum {
enum {
STR_NONE = -1,
STR_GUEST = 767,
STR_DATE_DAY_1 = 779,
STR_DATE_DAY_2 = STR_DATE_DAY_1 + 1,
STR_DATE_DAY_3 = STR_DATE_DAY_1 + 2,
@@ -287,6 +289,8 @@ enum {
STR_OPEN = 1196,
STR_BROKEN_DOWN = 1197,
STR_CRASHED = 1198,
STR_PERSON_ON_RIDE = 1199,
STR_PEOPLE_ON_RIDE = 1200,
STR_QUEUE_EMPTY = 1201,
STR_QUEUE_ONE_PERSON = 1202,
@@ -357,6 +361,9 @@ enum {
STR_CANT_OPEN_PARK = 1723,
STR_CANT_CLOSE_PARK = 1724,
STR_RACE_WON_BY_GUEST = 1739,
STR_RACE_WON_BY = 1740,
STR_INDIVIDUAL_GUESTS_TIP = 1752,
STR_SUMMARISED_GUESTS_TIP = 1753,
STR_ADMISSION_PRICE = 1756,

View File

@@ -23,6 +23,7 @@
#include "game.h"
#include "ride.h"
#include "string_ids.h"
#include "sprite.h"
#include "sprites.h"
#include "widget.h"
#include "window.h"
@@ -437,11 +438,45 @@ static void window_ride_list_paint()
*/
static void ride_get_status(int rideIndex, int *formatSecondary, int *argument)
{
int eax = 0, ebx = 0, ecx = 0, edx, esi = 0, edi = 0, ebp = 0;
edx = rideIndex;
RCT2_CALLFUNC_X(0x006AF561, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
*formatSecondary = ebx & 0xFFFF;
*argument = eax;
rct_ride *ride = &g_ride_list[rideIndex];
if (ride->lifecycle_flags & RIDE_LIFECYCLE_CRASHED) {
*formatSecondary = STR_CRASHED;
return;
}
if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) {
*formatSecondary = STR_BROKEN_DOWN;
return;
}
if (ride->status == RIDE_STATUS_CLOSED) {
*formatSecondary = STR_CLOSED;
return;
}
if (ride->status == RIDE_STATUS_TESTING) {
*formatSecondary = STR_TEST_RUN;
return;
}
ride->mode = RIDE_MODE_RACE;
rct_peep *peep = GET_PEEP(ride->race_winner);
if (ride->mode == RIDE_MODE_RACE && !(ride->lifecycle_flags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) && ride->race_winner != 0xFFFF && peep->sprite_identifier == SPRITE_IDENTIFIER_PEEP) {
if (peep->name_string_idx == STR_GUEST) {
*argument = peep->id;
*formatSecondary = STR_RACE_WON_BY_GUEST;
} else {
*argument = peep->name_string_idx;
*formatSecondary = STR_RACE_WON_BY;
}
} else {
if (!(RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + ride->type * 8, uint32) & 0x20000)) {
*formatSecondary = STR_PERSON_ON_RIDE;
*argument = ride->num_riders;
if(*argument != 1) {
*formatSecondary = STR_PEOPLE_ON_RIDE;
}
} else {
*formatSecondary = STR_OPEN;
}
}
}
/**