place-sounds/data-final-fixes.lua

changeset 12
2e09a72b2dfa
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/place-sounds/data-final-fixes.lua	Wed Jul 02 23:53:32 2025 +0300
@@ -0,0 +1,18 @@
+---@class entity EntityPrototype
+---@class item ItemPrototype
+local function copy_item_sounds_to_entity(item, entity)
+    entity.open_sound = table.deepcopy(item.pick_sound)
+    entity.close_sound = table.deepcopy(item.drop_sound)
+end
+
+-- prevent metallic machine sounds when placing power poles
+local sounds = require("__base__.prototypes.entity.sounds")
+for _, electric_pole in pairs(data.raw["electric-pole"])
+do
+    electric_pole.open_sound = sounds.electric_large_open
+    electric_pole.close_sound = sounds.electric_large_close
+end
+
+-- prevent metallic machine sounds when placing stuff made of bricks
+copy_item_sounds_to_entity(data.raw.item["stone-furnace"], data.raw.furnace["stone-furnace"])
+copy_item_sounds_to_entity(data.raw.item["stone-wall"], data.raw.wall["stone-wall"])

mercurial