Added rct_peep struct union (staff_id and guest_peep_varC5)

This commit is contained in:
King_Hual 2014-09-15 22:50:34 +03:00
parent ec9177123c
commit 1c1db75c28
4 changed files with 16 additions and 12 deletions

View File

@ -113,7 +113,7 @@ void marketing_set_guest_campaign(rct_peep *peep, int campaign)
peep->item_standard_flags |= PEEP_ITEM_VOUCHER;
peep->var_F0 = 1;
peep->var_F1 = RCT2_ADDRESS(0x01358116, uint8)[campaign];
peep->staff_id = RCT2_ADDRESS(0x01358116, uint8)[campaign];
peep->guest_peep_varC5 = RCT2_ADDRESS(0x01358116, uint8)[campaign];
peep->var_C6 = 240;
break;
case ADVERTISING_CAMPAIGN_PARK_ENTRY_HALF_PRICE:
@ -128,7 +128,7 @@ void marketing_set_guest_campaign(rct_peep *peep, int campaign)
case ADVERTISING_CAMPAIGN_PARK:
break;
case ADVERTISING_CAMPAIGN_RIDE:
peep->staff_id = RCT2_ADDRESS(0x01358116, uint8)[campaign];
peep->guest_peep_varC5 = RCT2_ADDRESS(0x01358116, uint8)[campaign];
peep->var_C6 = 240;
break;
}

View File

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

View File

@ -386,7 +386,11 @@ typedef struct {
uint16 var_AE;
rct_peep_thought thoughts[PEEP_MAX_THOUGHTS]; // 0xB0
uint8 var_C4; // 0xC4
uint8 staff_id;
union
{
uint8 staff_id;
uint8 guest_peep_varC5;
};
uint8 var_C6;
uint8 photo1_ride_ref; // 0xC7
uint32 flags; // 0xC8

View File

@ -290,4 +290,4 @@ void sub_6C0C3F()
}
}
}
}
}