Checking for no_money flag when checking ride price

This commit is contained in:
Hielke Morsink 2016-04-21 19:21:09 +02:00
parent 09688b427e
commit 87953f34db
1 changed files with 6 additions and 7 deletions

View File

@ -2099,7 +2099,7 @@ static void peep_go_to_ride_exit(rct_peep* peep, rct_ride* ride, sint16 x, sint1
* rct2: 0x006920B4
*/
static void peep_update_ride_sub_state_2_enter_ride(rct_peep* peep, rct_ride* ride){
if (ride->price != 0){
if (ride->price != 0 && !(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)){
if ((peep->item_standard_flags & PEEP_ITEM_VOUCHER) &&
(peep->voucher_type == VOUCHER_TYPE_RIDE_FREE) &&
(peep->voucher_arguments == peep->current_ride)){
@ -8457,8 +8457,7 @@ static int sub_693C9E(rct_peep *peep)
*/
static void peep_spend_money(rct_peep *peep, money16 *peep_expend_type, money32 amount)
{
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)
return;
assert(!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY));
peep->cash_in_pocket = max(0, peep->cash_in_pocket - amount);
peep->cash_spent += amount;
@ -9057,13 +9056,13 @@ loc_69B221:
// Sets the expenditure type to *_FOODDRINK_SALES or *_SHOP_SALES appropriately.
RCT2_GLOBAL(RCT2_ADDRESS_NEXT_EXPENDITURE_TYPE, uint8) -= 4;
if (!has_voucher)
peep_spend_money(peep, expend_type, price);
else {
if (has_voucher) {
peep->item_standard_flags &= ~PEEP_ITEM_VOUCHER;
peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY;
}
else if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) {
peep_spend_money(peep, expend_type, price);
}
ride->total_profit += (price - get_shop_item_cost(shopItem));
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
ride->cur_num_customers++;