diff --git a/src/date.c b/src/date.c index 012e556327..e44d32c86e 100644 --- a/src/date.c +++ b/src/date.c @@ -22,6 +22,10 @@ #include "date.h" #include "rct2.h" +// rtc2: 0x00993988 +const sint16 days_in_month[MONTH_COUNT] = { 31, 30, 31, 30, 31, 31, 30, 31 }; + + int date_get_month(int months) { return months % MONTH_COUNT; diff --git a/src/date.h b/src/date.h index 49e603a0ac..23eae8cdc9 100644 --- a/src/date.h +++ b/src/date.h @@ -21,6 +21,8 @@ #ifndef _DATE_H_ #define _DATE_H_ +#include "rct2.h" + enum { MONTH_MARCH, MONTH_APRIL, @@ -34,6 +36,8 @@ enum { MONTH_COUNT }; +extern const sint16 days_in_month[MONTH_COUNT]; + int date_get_month(int months); int date_get_total_months(int month, int year); void date_reset(); diff --git a/src/peep.h b/src/peep.h index 335cbedf0b..a13e7b2894 100644 --- a/src/peep.h +++ b/src/peep.h @@ -30,6 +30,13 @@ enum PEEP_TYPE { PEEP_TYPE_STAFF }; +enum STAFF_TYPE { + STAFF_TYPE_HANDYMAN, + STAFF_TYPE_MECHANIC, + STAFF_TYPE_SECURITY, + STAFF_TYPE_ENTERTAINER +}; + enum { PEEP_FLAGS_TRACKING = 8 }; @@ -65,7 +72,7 @@ typedef struct { uint8 pad_2C; uint8 sprite_type; // 0x2D uint8 type; // 0x2E - uint8 var_2F; + uint8 staff_type; // 0x2F uint8 var_30; uint8 var_31; uint8 pad_32[0x08]; diff --git a/src/window_game_bottom_toolbar.c b/src/window_game_bottom_toolbar.c index c161165956..5c8f4e6cbd 100644 --- a/src/window_game_bottom_toolbar.c +++ b/src/window_game_bottom_toolbar.c @@ -20,6 +20,7 @@ #include "addresses.h" #include "climate.h" +#include "date.h" #include "news_item.h" #include "park.h" #include "peep.h" @@ -220,7 +221,7 @@ static void window_game_bottom_toolbar_tooltip() break; case WIDX_DATE: month = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16) & 7; - day = ((RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_DAY, sint16) * ((short*)0x00993988)[month]) >> 16) & 0xFF; + day = ((RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_DAY, sint16) * days_in_month[month]) >> 16) & 0xFF; *((short*)0x013CE952) = STR_DATE_DAY_1 + day; *((short*)0x013CE954) = STR_MONTH_MARCH + month; widgetIndex = 0;