Merge pull request #454 from duncanspumpkin/fix_432_and_peep

Fix #432 and a few more peep variables named
This commit is contained in:
Ted John 2014-09-16 18:58:28 +01:00
commit 4a77bec8fa
6 changed files with 40 additions and 28 deletions

View File

@ -107,28 +107,28 @@ void marketing_set_guest_campaign(rct_peep *peep, int campaign)
switch (campaign) {
case ADVERTISING_CAMPAIGN_PARK_ENTRY_FREE:
peep->item_standard_flags |= PEEP_ITEM_VOUCHER;
peep->var_F0 = 0;
peep->voucher_type = VOUCHER_TYPE_PARK_ENTRY_FREE;
break;
case ADVERTISING_CAMPAIGN_RIDE_FREE:
peep->item_standard_flags |= PEEP_ITEM_VOUCHER;
peep->var_F0 = 1;
peep->var_F1 = RCT2_ADDRESS(0x01358116, uint8)[campaign];
peep->guest_peep_varC5 = RCT2_ADDRESS(0x01358116, uint8)[campaign];
peep->voucher_type = VOUCHER_TYPE_RIDE_FREE;
peep->voucher_arguments = RCT2_ADDRESS(0x01358116, uint8)[campaign];
peep->guest_heading_to_ride_id = RCT2_ADDRESS(0x01358116, uint8)[campaign];
peep->var_C6 = 240;
break;
case ADVERTISING_CAMPAIGN_PARK_ENTRY_HALF_PRICE:
peep->item_standard_flags |= PEEP_ITEM_VOUCHER;
peep->var_F0 = 2;
peep->voucher_type = VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE;
break;
case ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE:
peep->item_standard_flags |= PEEP_ITEM_VOUCHER;
peep->var_F0 = 3;
peep->var_F1 = RCT2_ADDRESS(0x01358116, uint8)[campaign];
peep->voucher_type = VOUCHER_TYPE_FOOD_OR_DRINK_FREE;
peep->voucher_arguments = RCT2_ADDRESS(0x01358116, uint8)[campaign];
break;
case ADVERTISING_CAMPAIGN_PARK:
break;
case ADVERTISING_CAMPAIGN_RIDE:
peep->guest_peep_varC5 = RCT2_ADDRESS(0x01358116, uint8)[campaign];
peep->guest_heading_to_ride_id = RCT2_ADDRESS(0x01358116, uint8)[campaign];
peep->var_C6 = 240;
break;
}

View File

@ -33,6 +33,13 @@ enum {
ADVERTISING_CAMPAIGN_COUNT
};
enum{
VOUCHER_TYPE_PARK_ENTRY_FREE,
VOUCHER_TYPE_RIDE_FREE,
VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE,
VOUCHER_TYPE_FOOD_OR_DRINK_FREE,
};
extern const money16 AdvertisingCampaignPricePerWeek[6];
int marketing_get_campaign_guest_generation_probability(int campaign);

View File

@ -178,31 +178,31 @@ void peep_problem_warnings_update()
break;
case PEEP_THOUGHT_TYPE_HUNGRY: // 0x14
if (peep->guest_peep_varC5 == -1){
if (peep->guest_heading_to_ride_id == -1){
hunger_counter++;
break;
}
ride = &g_ride_list[peep->guest_peep_varC5];
ride = &g_ride_list[peep->guest_heading_to_ride_id];
if (!(RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + ride->type * 8, uint32) & 0x80000))
hunger_counter++;
break;
case PEEP_THOUGHT_TYPE_THIRSTY:
if (peep->guest_peep_varC5 == -1){
if (peep->guest_heading_to_ride_id == -1){
thirst_counter++;
break;
}
ride = &g_ride_list[peep->guest_peep_varC5];
ride = &g_ride_list[peep->guest_heading_to_ride_id];
if (!(RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + ride->type * 8, uint32) & 0x1000000))
thirst_counter++;
break;
case PEEP_THOUGHT_TYPE_BATHROOM:
if (peep->guest_peep_varC5 == -1){
if (peep->guest_heading_to_ride_id == -1){
bathroom_counter++;
break;
}
ride = &g_ride_list[peep->guest_peep_varC5];
ride = &g_ride_list[peep->guest_heading_to_ride_id];
if (!(RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + ride->type * 8, uint32) & 0x2000000))
bathroom_counter++;
break;
@ -448,8 +448,8 @@ void get_arguments_from_action(rct_peep* peep, uint32 *argument_1, uint32* argum
break;
case PEEP_STATE_WALKING:
case 0x14:
if (peep->guest_peep_varC5 != 0xFF){
ride = g_ride_list[peep->guest_peep_varC5];
if (peep->guest_heading_to_ride_id != 0xFF){
ride = g_ride_list[peep->guest_heading_to_ride_id];
*argument_1 = STR_HEADING_FOR | (ride.name << 16);
*argument_2 = ride.name_arguments;
}

View File

@ -332,7 +332,10 @@ typedef struct {
uint8 pad_2C;
uint8 sprite_type; // 0x2D
uint8 type; // 0x2E
uint8 staff_type; // 0x2F Also used for no_of_rides
union{ // 0x2F
uint8 staff_type;
uint8 no_of_rides;
};
uint8 tshirt_colour; // 0x30
uint8 trousers_colour; // 0x31
uint16 var_32;
@ -388,10 +391,10 @@ typedef struct {
uint16 var_AE;
rct_peep_thought thoughts[PEEP_MAX_THOUGHTS]; // 0xB0
uint8 var_C4; // 0xC4
union
union // 0xC5
{
uint8 staff_id;
uint8 guest_peep_varC5;
uint8 guest_heading_to_ride_id;
};
uint8 var_C6;
uint8 photo1_ride_ref; // 0xC7
@ -410,8 +413,8 @@ typedef struct {
uint8 no_of_drinks; // 0xED
uint8 no_of_souvenirs; // 0xEE
uint8 pad_EF;
uint8 var_F0; //voucher_type
uint8 var_F1; //voucher_type arguments i.e. ride_id
uint8 voucher_type; // 0xF0
uint8 voucher_arguments; // 0xF1 ride_id or string_offset_id
uint8 pad_F2;
uint8 var_F3;
uint8 pad_F4[0x02];

View File

@ -442,6 +442,7 @@ static void widget_text_unknown(rct_drawpixelinfo *dpi, rct_window *w, int widge
widget->right - widget->left - 2
);
} else {
colour &= ~(1 << 7);
if (widget_is_disabled(w, widgetIndex))
colour |= 0x40;
gfx_draw_string_centred_clipped(

View File

@ -21,6 +21,7 @@
#include "addresses.h"
#include "game.h"
#include "map.h"
#include "marketing.h"
#include "ride.h"
#include "peep.h"
#include "scenario.h"
@ -1839,8 +1840,8 @@ void window_peep_finance_paint(){
// Paid on rides
y += 10;
RCT2_GLOBAL(0x13CE952, money32) = peep->paid_on_rides;
RCT2_GLOBAL(0x13CE956, uint16) = peep->staff_type;
if (peep->staff_type != 1){
RCT2_GLOBAL(0x13CE956, uint16) = peep->no_of_rides;
if (peep->no_of_rides != 1){
gfx_draw_string_left(dpi, 2298, (void*)0x13CE952, 0, x, y);
}
else{
@ -2105,19 +2106,19 @@ void window_peep_inventory_paint(){
RCT2_GLOBAL(0x13CE95A, uint32) = ride->name_arguments;
break;
case PEEP_ITEM_VOUCHER:
RCT2_GLOBAL(0x13CE958, uint16) = peep->var_F0 + 2418;
RCT2_GLOBAL(0x13CE958, uint16) = peep->voucher_type + 2418;
RCT2_GLOBAL(0x13CE95A, uint16) = RCT2_GLOBAL(0x13573D4, uint16);
RCT2_GLOBAL(0x13CE95C, uint32) = RCT2_GLOBAL(0x13573D8, uint32);
if (peep->var_F0 == 0 || peep->var_F0 == 2)break;
if (peep->voucher_type == VOUCHER_TYPE_PARK_ENTRY_FREE || peep->voucher_type == VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE)break;
int voucher_id = peep->var_F1 + 1988;
int voucher_id = peep->voucher_arguments + 1988;
if (voucher_id >= 2020) voucher_id += 102;
RCT2_GLOBAL(0x13CE95A, uint16) = voucher_id;
if (peep->var_F0 == 3)break;
ride = GET_RIDE(peep->var_F1);
if (peep->voucher_type == VOUCHER_TYPE_FOOD_OR_DRINK_FREE)break;
ride = GET_RIDE(peep->voucher_arguments);
RCT2_GLOBAL(0x13CE95A, uint16) = ride->name;
RCT2_GLOBAL(0x13CE95C, uint32) = ride->name_arguments;
break;