diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index f8502445f9..ee815656a4 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -232,7 +232,7 @@ static money32 BannerPlace( } *bannerIndex = create_new_banner(flags); - if (*bannerIndex == BANNER_NULL) + if (*bannerIndex == BANNER_INDEX_NULL) { return MONEY32_UNDEFINED; } @@ -505,7 +505,7 @@ void fix_duplicated_banners() // Banner index is already in use by another banner, so duplicate it BannerIndex newBannerIndex = create_new_banner(GAME_COMMAND_FLAG_APPLY); - if (newBannerIndex == BANNER_NULL) + if (newBannerIndex == BANNER_INDEX_NULL) { log_error("Failed to create new banner."); continue; diff --git a/src/openrct2/world/Banner.h b/src/openrct2/world/Banner.h index 0a88789f8a..0993107d00 100644 --- a/src/openrct2/world/Banner.h +++ b/src/openrct2/world/Banner.h @@ -14,15 +14,14 @@ *****************************************************************************/ #pragma endregion -#ifndef _BANNER_H_ -#define _BANNER_H_ +#pragma once #include "../common.h" #include "TileElement.h" -#define BANNER_NULL 255 -#define MAX_BANNERS 250 -#define BANNER_INDEX_NULL ((BannerIndex)-1) +constexpr uint8 BANNER_NULL = 255; +constexpr size_t MAX_BANNERS = 250; +constexpr BannerIndex BANNER_INDEX_NULL = (BannerIndex)-1; #pragma pack(push, 1) struct rct_banner @@ -59,5 +58,3 @@ uint8 banner_get_closest_ride_index(sint32 x, sint32 y, sint32 z); void banner_reset_broken_index(); void fix_duplicated_banners(); void game_command_callback_place_banner(sint32 eax, sint32 ebx, sint32 ecx, sint32 edx, sint32 esi, sint32 edi, sint32 ebp); - -#endif diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index ccdf8c8d6e..7e4d91e0cd 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -309,7 +309,7 @@ sint32 tile_inspector_paste_element_at(sint32 x, sint32 y, rct_tile_element elem { // The element to be pasted refers to a banner index - make a copy of it BannerIndex newBannerIndex = create_new_banner(flags); - if (newBannerIndex == BANNER_NULL) + if (newBannerIndex == BANNER_INDEX_NULL) { return MONEY32_UNDEFINED; }