1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 03:23:15 +01:00

fix scenery cursor bug, get rid of multiple unneccessary returns

This commit is contained in:
qcz
2014-09-06 12:52:30 +02:00
parent 288afe14b8
commit 36d2c47706

View File

@@ -700,30 +700,29 @@ static void window_scenery_update(rct_window *w)
if (!window_scenery_is_scenery_tool_active())
window_close(w);
if (RCT2_GLOBAL(0x00F64F19, uint8) != 1) {
if (RCT2_GLOBAL(0x00F64F19, uint8) == 1) {
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) = 0x17;
return;
}
} else {
uint16 tabIndex = RCT2_GLOBAL(0x00F64EDC, uint8);
sint16 tabSelectedSceneryId = RCT2_ADDRESS(0x00F64EDD, sint16)[tabIndex];
uint16 tabIndex = RCT2_GLOBAL(0x00F64EDC, uint8);
sint16 tabSelectedSceneryId = RCT2_ADDRESS(0x00F64EDD, sint16)[tabIndex];
if (tabSelectedSceneryId == -1)
return;
if (tabSelectedSceneryId > 0x400) { // banner
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) = 0x18;
} else if (tabSelectedSceneryId > 0x300) { // large scenery
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) =
g_largeSceneryEntries[tabSelectedSceneryId - 0x300]->large_scenery.tool_id;
} else if (tabSelectedSceneryId > 0x200) { // wall
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) =
g_wallSceneryEntries[tabSelectedSceneryId - 0x200]->wall.tool_id;
} else if (tabSelectedSceneryId > 0x100) { // path bit
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) =
g_pathBitSceneryEntries[tabSelectedSceneryId - 0x100]->path_bit.tool_id;
} else { // small scenery
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) =
g_smallSceneryEntries[tabSelectedSceneryId]->small_scenery.tool_id;
if (tabSelectedSceneryId != -1) {
if (tabSelectedSceneryId > 0x400) { // banner
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) = 0x18;
} else if (tabSelectedSceneryId > 0x300) { // large scenery
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) =
g_largeSceneryEntries[tabSelectedSceneryId - 0x300]->large_scenery.tool_id;
} else if (tabSelectedSceneryId > 0x200) { // wall
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) =
g_wallSceneryEntries[tabSelectedSceneryId - 0x200]->wall.tool_id;
} else if (tabSelectedSceneryId > 0x100) { // path bit
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) =
g_pathBitSceneryEntries[tabSelectedSceneryId - 0x100]->path_bit.tool_id;
} else { // small scenery
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) =
g_smallSceneryEntries[tabSelectedSceneryId]->small_scenery.tool_id;
}
}
}
}