mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use IsBroken
This commit is contained in:
parent
7840f6a7f7
commit
fae15fceca
|
@ -366,7 +366,7 @@ int32_t viewport_interaction_get_item_right(int32_t x, int32_t y, viewport_inter
|
||||||
case VIEWPORT_INTERACTION_ITEM_FOOTPATH_ITEM:
|
case VIEWPORT_INTERACTION_ITEM_FOOTPATH_ITEM:
|
||||||
sceneryEntry = tileElement->AsPath()->GetAdditionEntry();
|
sceneryEntry = tileElement->AsPath()->GetAdditionEntry();
|
||||||
set_map_tooltip_format_arg(0, rct_string_id, STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE);
|
set_map_tooltip_format_arg(0, rct_string_id, STR_MAP_TOOLTIP_STRINGID_CLICK_TO_REMOVE);
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
{
|
{
|
||||||
set_map_tooltip_format_arg(2, rct_string_id, STR_BROKEN);
|
set_map_tooltip_format_arg(2, rct_string_id, STR_BROKEN);
|
||||||
set_map_tooltip_format_arg(4, rct_string_id, sceneryEntry->name);
|
set_map_tooltip_format_arg(4, rct_string_id, sceneryEntry->name);
|
||||||
|
|
|
@ -2186,7 +2186,7 @@ static void window_tile_inspector_scrollpaint(rct_window* w, rct_drawpixelinfo*
|
||||||
const int32_t baseHeight = tileElement->base_height;
|
const int32_t baseHeight = tileElement->base_height;
|
||||||
const int32_t clearanceHeight = tileElement->clearance_height;
|
const int32_t clearanceHeight = tileElement->clearance_height;
|
||||||
const bool ghost = tileElement->IsGhost();
|
const bool ghost = tileElement->IsGhost();
|
||||||
const bool broken = (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN) != 0;
|
const bool broken = tileElement->AsPath() == nullptr ? false : tileElement->AsPath()->IsBroken();
|
||||||
const bool last = (tileElement->flags & TILE_ELEMENT_FLAG_LAST_TILE) != 0;
|
const bool last = (tileElement->flags & TILE_ELEMENT_FLAG_LAST_TILE) != 0;
|
||||||
|
|
||||||
const rct_string_id stringFormat = (selectedRow || hoveredRow) ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID;
|
const rct_string_id stringFormat = (selectedRow || hoveredRow) ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID;
|
||||||
|
|
|
@ -102,7 +102,7 @@ static void path_bit_lights_paint(
|
||||||
{
|
{
|
||||||
imageId = pathBitEntry->image + 1;
|
imageId = pathBitEntry->image + 1;
|
||||||
|
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
imageId += 4;
|
imageId += 4;
|
||||||
|
|
||||||
imageId |= pathBitImageFlags;
|
imageId |= pathBitImageFlags;
|
||||||
|
@ -113,7 +113,7 @@ static void path_bit_lights_paint(
|
||||||
{
|
{
|
||||||
imageId = pathBitEntry->image + 2;
|
imageId = pathBitEntry->image + 2;
|
||||||
|
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
imageId += 4;
|
imageId += 4;
|
||||||
|
|
||||||
imageId |= pathBitImageFlags;
|
imageId |= pathBitImageFlags;
|
||||||
|
@ -125,7 +125,7 @@ static void path_bit_lights_paint(
|
||||||
{
|
{
|
||||||
imageId = pathBitEntry->image + 3;
|
imageId = pathBitEntry->image + 3;
|
||||||
|
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
imageId += 4;
|
imageId += 4;
|
||||||
|
|
||||||
imageId |= pathBitImageFlags;
|
imageId |= pathBitImageFlags;
|
||||||
|
@ -137,7 +137,7 @@ static void path_bit_lights_paint(
|
||||||
{
|
{
|
||||||
imageId = pathBitEntry->image + 4;
|
imageId = pathBitEntry->image + 4;
|
||||||
|
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
imageId += 4;
|
imageId += 4;
|
||||||
|
|
||||||
imageId |= pathBitImageFlags;
|
imageId |= pathBitImageFlags;
|
||||||
|
@ -155,7 +155,7 @@ static void path_bit_bins_paint(
|
||||||
height += 8;
|
height += 8;
|
||||||
|
|
||||||
uint32_t imageId;
|
uint32_t imageId;
|
||||||
bool binsAreVandalised = tileElement->flags & TILE_ELEMENT_FLAG_BROKEN;
|
bool binsAreVandalised = tileElement->AsPath()->IsBroken();
|
||||||
|
|
||||||
if (!(edges & EDGE_NE))
|
if (!(edges & EDGE_NE))
|
||||||
{
|
{
|
||||||
|
@ -256,7 +256,7 @@ static void path_bit_benches_paint(
|
||||||
{
|
{
|
||||||
imageId = pathBitEntry->image + 1;
|
imageId = pathBitEntry->image + 1;
|
||||||
|
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
imageId += 4;
|
imageId += 4;
|
||||||
|
|
||||||
imageId |= pathBitImageFlags;
|
imageId |= pathBitImageFlags;
|
||||||
|
@ -267,7 +267,7 @@ static void path_bit_benches_paint(
|
||||||
{
|
{
|
||||||
imageId = pathBitEntry->image + 2;
|
imageId = pathBitEntry->image + 2;
|
||||||
|
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
imageId += 4;
|
imageId += 4;
|
||||||
|
|
||||||
imageId |= pathBitImageFlags;
|
imageId |= pathBitImageFlags;
|
||||||
|
@ -279,7 +279,7 @@ static void path_bit_benches_paint(
|
||||||
{
|
{
|
||||||
imageId = pathBitEntry->image + 3;
|
imageId = pathBitEntry->image + 3;
|
||||||
|
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
imageId += 4;
|
imageId += 4;
|
||||||
|
|
||||||
imageId |= pathBitImageFlags;
|
imageId |= pathBitImageFlags;
|
||||||
|
@ -291,7 +291,7 @@ static void path_bit_benches_paint(
|
||||||
{
|
{
|
||||||
imageId = pathBitEntry->image + 4;
|
imageId = pathBitEntry->image + 4;
|
||||||
|
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
imageId += 4;
|
imageId += 4;
|
||||||
|
|
||||||
imageId |= pathBitImageFlags;
|
imageId |= pathBitImageFlags;
|
||||||
|
@ -704,7 +704,7 @@ static void sub_6A3F61(
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((session->ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)
|
if ((session->ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)
|
||||||
&& !(tile_element->flags & TILE_ELEMENT_FLAG_BROKEN)
|
&& !(tile_element->AsPath()->IsBroken())
|
||||||
&& !(sceneryEntry->path_bit.draw_type == PATH_BIT_DRAW_TYPE_BINS))
|
&& !(sceneryEntry->path_bit.draw_type == PATH_BIT_DRAW_TYPE_BINS))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -948,7 +948,7 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile
|
||||||
#ifdef __ENABLE_LIGHTFX__
|
#ifdef __ENABLE_LIGHTFX__
|
||||||
if (lightfx_is_available())
|
if (lightfx_is_available())
|
||||||
{
|
{
|
||||||
if (tile_element->AsPath()->HasAddition() && !(tile_element->flags & TILE_ELEMENT_FLAG_BROKEN))
|
if (tile_element->AsPath()->HasAddition() && !(tile_element->AsPath()->IsBroken()))
|
||||||
{
|
{
|
||||||
rct_scenery_entry* sceneryEntry = tile_element->AsPath()->GetAdditionEntry();
|
rct_scenery_entry* sceneryEntry = tile_element->AsPath()->GetAdditionEntry();
|
||||||
if (sceneryEntry != nullptr && sceneryEntry->path_bit.flags & PATH_BIT_FLAG_LAMP)
|
if (sceneryEntry != nullptr && sceneryEntry->path_bit.flags & PATH_BIT_FLAG_LAMP)
|
||||||
|
|
|
@ -2728,7 +2728,7 @@ static PeepThoughtType peep_assess_surroundings(int16_t centre_x, int16_t centre
|
||||||
num_fountains++;
|
num_fountains++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
{
|
{
|
||||||
num_rubbish++;
|
num_rubbish++;
|
||||||
}
|
}
|
||||||
|
@ -5782,7 +5782,7 @@ void rct_peep::UpdateUsingBin()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
{
|
{
|
||||||
StateReset();
|
StateReset();
|
||||||
return;
|
return;
|
||||||
|
@ -5945,7 +5945,7 @@ bool rct_peep::UpdateWalkingFindBench()
|
||||||
if (sceneryEntry == nullptr || !(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_BENCH))
|
if (sceneryEntry == nullptr || !(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_BENCH))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (tileElement->AsPath()->AdditionIsGhost())
|
if (tileElement->AsPath()->AdditionIsGhost())
|
||||||
|
@ -6044,7 +6044,7 @@ bool rct_peep::UpdateWalkingFindBin()
|
||||||
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_BIN))
|
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_BIN))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (tileElement->AsPath()->AdditionIsGhost())
|
if (tileElement->AsPath()->AdditionIsGhost())
|
||||||
|
@ -6141,7 +6141,7 @@ static void peep_update_walking_break_scenery(rct_peep* peep)
|
||||||
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BREAKABLE))
|
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BREAKABLE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (tileElement->AsPath()->AdditionIsGhost())
|
if (tileElement->AsPath()->AdditionIsGhost())
|
||||||
|
|
|
@ -2874,7 +2874,7 @@ static void peep_interact_with_path(rct_peep* peep, int16_t x, int16_t y, TileEl
|
||||||
{
|
{
|
||||||
// 0x00F1AEE2
|
// 0x00F1AEE2
|
||||||
bool vandalism_present = false;
|
bool vandalism_present = false;
|
||||||
if (tile_element->AsPath()->HasAddition() && (tile_element->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tile_element->AsPath()->HasAddition() && (tile_element->AsPath()->IsBroken())
|
||||||
&& (tile_element->AsPath()->GetEdges()) != 0xF)
|
&& (tile_element->AsPath()->GetEdges()) != 0xF)
|
||||||
{
|
{
|
||||||
vandalism_present = true;
|
vandalism_present = true;
|
||||||
|
|
|
@ -1729,7 +1729,7 @@ void rct_peep::UpdateEmptyingBin()
|
||||||
}
|
}
|
||||||
|
|
||||||
rct_scenery_entry* scenery_entry = tile_element->AsPath()->GetAdditionEntry();
|
rct_scenery_entry* scenery_entry = tile_element->AsPath()->GetAdditionEntry();
|
||||||
if (!(scenery_entry->path_bit.flags & PATH_BIT_FLAG_IS_BIN) || tile_element->flags & TILE_ELEMENT_FLAG_BROKEN
|
if (!(scenery_entry->path_bit.flags & PATH_BIT_FLAG_IS_BIN) || tile_element->AsPath()->IsBroken()
|
||||||
|| tile_element->AsPath()->AdditionIsGhost())
|
|| tile_element->AsPath()->AdditionIsGhost())
|
||||||
{
|
{
|
||||||
StateReset();
|
StateReset();
|
||||||
|
@ -2130,7 +2130,7 @@ static int32_t peep_update_patrolling_find_bin(rct_peep* peep)
|
||||||
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_BIN))
|
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_BIN))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN)
|
if (tileElement->AsPath()->IsBroken())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (tileElement->AsPath()->AdditionIsGhost())
|
if (tileElement->AsPath()->AdditionIsGhost())
|
||||||
|
|
|
@ -325,7 +325,7 @@ static money32 footpath_element_update(
|
||||||
else if (pathItemType != 0)
|
else if (pathItemType != 0)
|
||||||
{
|
{
|
||||||
if (!(flags & GAME_COMMAND_FLAG_GHOST) && tileElement->AsPath()->GetAddition() == pathItemType
|
if (!(flags & GAME_COMMAND_FLAG_GHOST) && tileElement->AsPath()->GetAddition() == pathItemType
|
||||||
&& !(tileElement->flags & TILE_ELEMENT_FLAG_BROKEN))
|
&& !(tileElement->AsPath()->IsBroken()))
|
||||||
{
|
{
|
||||||
if (flags & GAME_COMMAND_FLAG_4)
|
if (flags & GAME_COMMAND_FLAG_4)
|
||||||
return MONEY32_UNDEFINED;
|
return MONEY32_UNDEFINED;
|
||||||
|
|
Loading…
Reference in New Issue