mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
define BANNER_INDEX_NULL
This commit is contained in:
committed by
Hielke Morsink
parent
38d3c3eff3
commit
b78bd587b7
@@ -689,7 +689,7 @@ void scenario_fix_ghosts(rct_s6_data *s6)
|
||||
do {
|
||||
if (originalElement->flags & TILE_ELEMENT_FLAG_GHOST) {
|
||||
sint32 bannerIndex = tile_element_get_banner_index(originalElement);
|
||||
if (bannerIndex != -1) {
|
||||
if (bannerIndex != BANNER_INDEX_NULL) {
|
||||
rct_banner *banner = &s6->banners[bannerIndex];
|
||||
if (banner->type != BANNER_NULL)
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#define BANNER_NULL 255
|
||||
#define MAX_BANNERS 250
|
||||
#define BANNER_INDEX_NULL -1
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct rct_banner {
|
||||
|
||||
@@ -3553,19 +3553,19 @@ sint32 tile_element_get_banner_index(rct_tile_element *tileElement)
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
sceneryEntry = get_large_scenery_entry(scenery_large_get_type(tileElement));
|
||||
if (sceneryEntry->large_scenery.scrolling_mode == 0xFF)
|
||||
return -1;
|
||||
return BANNER_INDEX_NULL;
|
||||
|
||||
return scenery_large_get_banner_id(tileElement);
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
sceneryEntry = get_wall_entry(tileElement->properties.wall.type);
|
||||
if (sceneryEntry == nullptr || sceneryEntry->wall.scrolling_mode == 0xFF)
|
||||
return -1;
|
||||
return BANNER_INDEX_NULL;
|
||||
|
||||
return tileElement->properties.wall.banner_index;
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
return tileElement->properties.banner.index;
|
||||
default:
|
||||
return -1;
|
||||
return BANNER_INDEX_NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3591,7 +3591,7 @@ void tile_element_set_banner_index(rct_tile_element * tileElement, sint32 banner
|
||||
void tile_element_remove_banner_entry(rct_tile_element *tileElement)
|
||||
{
|
||||
sint32 bannerIndex = tile_element_get_banner_index(tileElement);
|
||||
if (bannerIndex == -1)
|
||||
if (bannerIndex == BANNER_INDEX_NULL)
|
||||
return;
|
||||
|
||||
rct_banner* banner = &gBanners[bannerIndex];
|
||||
|
||||
@@ -316,8 +316,7 @@ sint32 tile_inspector_paste_element_at(sint32 x, sint32 y, rct_tile_element elem
|
||||
{
|
||||
// Check if the element to be pasted refers to a banner index
|
||||
sint32 bannerIndex = tile_element_get_banner_index(&element);
|
||||
|
||||
if (bannerIndex != BANNER_NULL)
|
||||
if (bannerIndex != BANNER_INDEX_NULL)
|
||||
{
|
||||
// The element to be pasted refers to a banner index - make a copy of it
|
||||
sint32 newBannerIndex = create_new_banner(flags);
|
||||
|
||||
Reference in New Issue
Block a user