mirror of https://github.com/OpenRCT2/OpenRCT2.git
fix #3268: water tool sound even when no change
This commit is contained in:
parent
1947b1dd30
commit
37d759ffb7
|
@ -1993,6 +1993,7 @@ money32 lower_land(int flags, int x, int y, int z, int ax, int ay, int bx, int b
|
|||
money32 raise_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
|
||||
{
|
||||
money32 cost = 0;
|
||||
bool waterHeightChanged = false;
|
||||
|
||||
uint8 max_height = 0xFF;
|
||||
|
||||
|
@ -2034,6 +2035,7 @@ money32 raise_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
|
|||
return MONEY32_UNDEFINED;
|
||||
|
||||
cost += tileCost;
|
||||
waterHeightChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2058,8 +2060,10 @@ money32 raise_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
|
|||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16) = x;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16) = y;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16) = z;
|
||||
if (waterHeightChanged) {
|
||||
audio_play_sound_at_location(SOUND_LAYING_OUT_WATER, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
// Force ride construction to recheck area
|
||||
RCT2_GLOBAL(0x00F440B0, uint8) |= 8;
|
||||
|
@ -2070,6 +2074,7 @@ money32 raise_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
|
|||
money32 lower_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
|
||||
{
|
||||
money32 cost = 0;
|
||||
bool waterHeightChanged = false;
|
||||
|
||||
uint8 min_height = 0;
|
||||
|
||||
|
@ -2106,6 +2111,7 @@ money32 lower_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
|
|||
if (tileCost == MONEY32_UNDEFINED)
|
||||
return MONEY32_UNDEFINED;
|
||||
cost += tileCost;
|
||||
waterHeightChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2130,8 +2136,10 @@ money32 lower_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
|
|||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16) = x;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16) = y;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16) = z;
|
||||
if (waterHeightChanged) {
|
||||
audio_play_sound_at_location(SOUND_LAYING_OUT_WATER, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
// Force ride construction to recheck area
|
||||
RCT2_GLOBAL(0x00F440B0, uint8) |= 8;
|
||||
|
|
Loading…
Reference in New Issue