Fix #6420: Demolishing rides refunds twice as much as the ride costs to build

This commit is contained in:
Duncan authored and Michael Steenbeek committed 2017-10-11 07:58:49 +02:00
1 parent e01cd0fd40
commit f97068d0b6
2 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@ typedef struct GameAction GameAction;
// This define 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 "12"
#define NETWORK_STREAM_VERSION "13"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
#ifdef __cplusplus
+5 -5
View File
@@ -5480,7 +5480,7 @@ sint32 ride_get_refund_price(sint32 ride_id)
if (type != TRACK_ELEM_INVERTED_90_DEG_UP_TO_FLAT_QUARTER_LOOP){
money32 removePrice = game_do_command(
x,
GAME_COMMAND_FLAG_APPLY | (rotation << 8),
GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_APPLY | (rotation << 8),
y,
type | (map_element_get_track_sequence(it.element) << 8),
GAME_COMMAND_REMOVE_TRACK,
@@ -5498,7 +5498,7 @@ sint32 ride_get_refund_price(sint32 ride_id)
// Using GAME_COMMAND_FLAG_2 for below commands as a HACK to stop fences from being removed
refundPrice += game_do_command(
x,
GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_2 | (0 << 8),
GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_2 | (0 << 8),
y,
ride_id | (2 << 8),
GAME_COMMAND_SET_MAZE_TRACK,
@@ -5507,7 +5507,7 @@ sint32 ride_get_refund_price(sint32 ride_id)
refundPrice += game_do_command(
x,
GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_2 | (1 << 8),
GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_2 | (1 << 8),
y + 16,
ride_id | (2 << 8),
GAME_COMMAND_SET_MAZE_TRACK,
@@ -5516,7 +5516,7 @@ sint32 ride_get_refund_price(sint32 ride_id)
refundPrice += game_do_command(
x + 16,
GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_2 | (2 << 8),
GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_2 | (2 << 8),
y + 16,
ride_id | (2 << 8),
GAME_COMMAND_SET_MAZE_TRACK,
@@ -5525,7 +5525,7 @@ sint32 ride_get_refund_price(sint32 ride_id)
refundPrice += game_do_command(
x + 16,
GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_2 | (3 << 8),
GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_2 | (3 << 8),
y,
ride_id | (2 << 8),
GAME_COMMAND_SET_MAZE_TRACK,