Skip to content

Commit

Permalink
Added check for No Money cheat for issue OpenRCT2#9957
Browse files Browse the repository at this point in the history
  • Loading branch information
gill984 authored and Gymnasiast committed Sep 22, 2019
1 parent 2e5f46f commit c2272b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/openrct2/peep/Guest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1551,12 +1551,12 @@ bool Guest::DecideAndBuyItem(Ride* ride, int32_t shopItem, money32 price)
{
if (price != 0)
{
if (cash_in_pocket == 0)
if ((cash_in_pocket == 0) && !(gParkFlags & PARK_FLAGS_NO_MONEY))
{
InsertNewThought(PEEP_THOUGHT_TYPE_SPENT_MONEY, PEEP_THOUGHT_ITEM_NONE);
return false;
}
if (price > cash_in_pocket)
if ((price > cash_in_pocket) && !(gParkFlags & PARK_FLAGS_NO_MONEY))
{
InsertNewThought(PEEP_THOUGHT_TYPE_CANT_AFFORD, shopItem);
return false;
Expand Down Expand Up @@ -2052,7 +2052,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
}

// Basic price checks
if (ridePrice != 0 && !peep_has_voucher_for_free_ride(this, ride))
if (ridePrice != 0 && !peep_has_voucher_for_free_ride(this, ride) && !(gParkFlags & PARK_FLAGS_NO_MONEY))
{
if (ridePrice > cash_in_pocket)
{
Expand Down Expand Up @@ -2641,7 +2641,7 @@ static bool peep_check_ride_price_at_entrance(Guest* peep, Ride* ride, money32 r
&& peep->voucher_arguments == peep->current_ride)
return true;

if (peep->cash_in_pocket <= 0)
if ((peep->cash_in_pocket <= 0) && !(gParkFlags & PARK_FLAGS_NO_MONEY))
{
peep->InsertNewThought(PEEP_THOUGHT_TYPE_SPENT_MONEY, PEEP_THOUGHT_ITEM_NONE);
peep_update_ride_at_entrance_try_leave(peep);
Expand Down

0 comments on commit c2272b9

Please sign in to comment.