Skip to content

Commit

Permalink
Revert operator++ removal
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanspumpkin committed Dec 8, 2020
1 parent 5d19111 commit 658cd7e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/Guest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1982,7 +1982,7 @@ void window_guest_inventory_paint(rct_window* w, rct_drawpixelinfo* dpi)
gfx_draw_string_left(dpi, STR_CARRYING, nullptr, COLOUR_BLACK, screenCoords);
screenCoords.y += 10;

for (ShopItem item = ShopItem::Balloon; item < ShopItem::Count; item = ShopItem(EnumValue(item) + 1))
for (ShopItem item = ShopItem::Balloon; item < ShopItem::Count; item++)
{
if (screenCoords.y >= maxY)
break;
Expand Down
5 changes: 5 additions & 0 deletions src/openrct2/ride/ShopItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
#include "../localisation/StringIds.h"
#include "../sprites.h"

ShopItem& operator++(ShopItem& d, int)
{
return d = (d == ShopItem::Count) ? ShopItem::Balloon : ShopItem(EnumValue(d) + 1);
}

uint64_t gSamePriceThroughoutPark;

// clang-format off
Expand Down
2 changes: 2 additions & 0 deletions src/openrct2/ride/ShopItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ enum class ShopItem : uint8_t
None = 255
};

ShopItem& operator++(ShopItem& d, int);

using ShopItemIndex = ShopItem;

struct ShopItemStrings
Expand Down

0 comments on commit 658cd7e

Please sign in to comment.