mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-17 12:03:07 +01:00
Modify game_command_remove_scenery to take unshifted scenery quadrant
This commit is contained in:
@@ -467,7 +467,7 @@ static void viewport_interaction_remove_scenery(rct_tile_element* tileElement, i
|
||||
{
|
||||
gGameCommandErrorTitle = STR_CANT_REMOVE_THIS;
|
||||
game_do_command(
|
||||
x, (tileElement->type << 8) | GAME_COMMAND_FLAG_APPLY, y,
|
||||
x, (tileElement->AsSmallScenery()->GetSceneryQuadrant() << 8) | GAME_COMMAND_FLAG_APPLY, y,
|
||||
(tileElement->AsSmallScenery()->GetEntryIndex() << 8) | tileElement->base_height, GAME_COMMAND_REMOVE_SCENERY, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -2416,7 +2416,7 @@ static money32 try_place_ghost_scenery(
|
||||
|
||||
tileElement = gSceneryTileElement;
|
||||
gSceneryGhostPosition.z = tileElement->base_height;
|
||||
gSceneryTileElementType = tileElement->type;
|
||||
gSceneryQuadrant = tileElement->AsSmallScenery()->GetSceneryQuadrant();
|
||||
if (gSceneryGroundFlags & ELEMENT_IS_UNDERGROUND)
|
||||
{
|
||||
// Set underground on
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
// This string specifies which version of network stream current build uses.
|
||||
// It is used for making sure only compatible builds get connected, even within
|
||||
// single OpenRCT2 version.
|
||||
#define NETWORK_STREAM_VERSION "1"
|
||||
#define NETWORK_STREAM_VERSION "2"
|
||||
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
|
||||
|
||||
static rct_peep* _pickup_peep = nullptr;
|
||||
|
||||
@@ -816,9 +816,6 @@ static int32_t track_design_place_scenery(
|
||||
uint8_t quadrant = (scenery->flags >> 2) + _currentTrackPieceDirection;
|
||||
quadrant &= 3;
|
||||
|
||||
// So called because it mirrors the SmallSceneryElement->type byte.
|
||||
uint8_t typeByte = rotation | (quadrant << 6) | TILE_ELEMENT_TYPE_SMALL_SCENERY;
|
||||
|
||||
rct_scenery_entry* small_scenery = get_small_scenery_entry(entry_index);
|
||||
if (!(!scenery_small_entry_has_flag(small_scenery, SMALL_SCENERY_FLAG_FULL_TILE)
|
||||
&& scenery_small_entry_has_flag(small_scenery, SMALL_SCENERY_FLAG_DIAGONAL))
|
||||
@@ -827,12 +824,12 @@ static int32_t track_design_place_scenery(
|
||||
SMALL_SCENERY_FLAG_DIAGONAL | SMALL_SCENERY_FLAG_HALF_SPACE
|
||||
| SMALL_SCENERY_FLAG_THREE_QUARTERS))
|
||||
{
|
||||
typeByte &= ~TILE_ELEMENT_QUADRANT_MASK;
|
||||
quadrant = 0;
|
||||
}
|
||||
|
||||
z = (scenery->z * 8 + originZ) / 8;
|
||||
game_do_command(
|
||||
mapCoord.x, flags | typeByte << 8, mapCoord.y, (entry_index << 8) | z, GAME_COMMAND_REMOVE_SCENERY,
|
||||
mapCoord.x, flags | quadrant << 8, mapCoord.y, (entry_index << 8) | z, GAME_COMMAND_REMOVE_SCENERY,
|
||||
0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1094,7 +1094,7 @@ restart_from_beginning:
|
||||
if (clear & (1 << 0))
|
||||
{
|
||||
int32_t eax = x * 32;
|
||||
int32_t ebx = (tileElement->type << 8) | flags;
|
||||
int32_t ebx = (tileElement->AsSmallScenery()->GetSceneryQuadrant() << 8) | flags;
|
||||
int32_t ecx = y * 32;
|
||||
int32_t edx = (tileElement->AsSmallScenery()->GetEntryIndex() << 8) | (tileElement->base_height);
|
||||
int32_t edi = 0, ebp = 0;
|
||||
|
||||
@@ -38,7 +38,7 @@ colour_t gWindowSceneryTertiaryColour;
|
||||
bool gWindowSceneryEyedropperEnabled;
|
||||
|
||||
rct_tile_element* gSceneryTileElement;
|
||||
uint8_t gSceneryTileElementType;
|
||||
uint8_t gSceneryQuadrant;
|
||||
|
||||
money32 gSceneryPlaceCost;
|
||||
int16_t gSceneryPlaceObject;
|
||||
@@ -187,7 +187,7 @@ void scenery_remove_ghost_tool_placement()
|
||||
uint8_t flags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_5
|
||||
| GAME_COMMAND_FLAG_GHOST;
|
||||
game_do_command(
|
||||
x, flags | (gSceneryTileElementType << 8), y, z | (gSceneryPlaceObject << 8), GAME_COMMAND_REMOVE_SCENERY, 0, 0);
|
||||
x, flags | (gSceneryQuadrant << 8), y, z | (gSceneryPlaceObject << 8), GAME_COMMAND_REMOVE_SCENERY, 0, 0);
|
||||
}
|
||||
|
||||
if (gSceneryGhostType & SCENERY_ENTRY_FLAG_1)
|
||||
|
||||
@@ -266,7 +266,7 @@ extern colour_t gWindowSceneryTertiaryColour;
|
||||
extern bool gWindowSceneryEyedropperEnabled;
|
||||
|
||||
extern rct_tile_element* gSceneryTileElement;
|
||||
extern uint8_t gSceneryTileElementType;
|
||||
extern uint8_t gSceneryQuadrant;
|
||||
|
||||
extern money32 gSceneryPlaceCost;
|
||||
extern int16_t gSceneryPlaceObject;
|
||||
|
||||
@@ -420,7 +420,7 @@ void game_command_remove_scenery(
|
||||
[[maybe_unused]] int32_t* ebp)
|
||||
{
|
||||
*ebx = SmallSceneryRemove(
|
||||
*eax & 0xFFFF, *ecx & 0xFFFF, *edx & 0xFF, ((*ebx >> 8) & 0xFF) >> 6, (*edx >> 8) & 0xFF, *ebx & 0xFF);
|
||||
*eax & 0xFFFF, *ecx & 0xFFFF, *edx & 0xFF, ((*ebx >> 8) & 0xFF), (*edx >> 8) & 0xFF, *ebx & 0xFF);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user