diff --git a/src/js/changelog.js b/src/js/changelog.js index cfa6acdb..e84cb269 100644 --- a/src/js/changelog.js +++ b/src/js/changelog.js @@ -8,6 +8,7 @@ export const CHANGELOG = [ "Allow clicking on variants to select them", "Allow clicking 'Q' over a shape or color patch to automatically select the miner building (by Gerdon262)", "Add 'copy key' button to shape viewer", + "Fix deconstruct sound being played when right clicking hub", "Add setting (on by default) to store the last used rotation per building instead of globally storing it (by Magos)", "Added chinese (traditional) translation", "Updated translations", diff --git a/src/js/game/hud/parts/building_placer_logic.js b/src/js/game/hud/parts/building_placer_logic.js index 179dfc45..c8c83acc 100644 --- a/src/js/game/hud/parts/building_placer_logic.js +++ b/src/js/game/hud/parts/building_placer_logic.js @@ -263,8 +263,9 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { const tile = worldPos.toTileSpace(); const contents = this.root.map.getTileContent(tile); if (contents) { - this.root.logic.tryDeleteBuilding(contents); - this.root.soundProxy.playUi(SOUNDS.destroyBuilding); + if (this.root.logic.tryDeleteBuilding(contents)) { + this.root.soundProxy.playUi(SOUNDS.destroyBuilding); + } } }