show-buildable/data-final-fixes.lua

Sat, 05 Jul 2025 00:35:41 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Sat, 05 Jul 2025 00:35:41 +0300
changeset 14
c26d4dd2af9b
permissions
-rw-r--r--

Add show-buildable mod

require"sb-util"

-- in case something changes conditions or collision masks in the meantime
for _, entity_type in pairs (entity_categories)
do
	for _, base_entity in pairs (data.raw[entity_type] or {})
	do
		local ct = data.raw["assembling-machine"]["collision-tester-"..base_entity.name]
		if ct
		then
			ct.collision_mask = table.deepcopy(base_entity.collision_mask)
			ct.collision_box = table.deepcopy(base_entity.collision_box)
			ct.surface_conditions = table.deepcopy(base_entity.surface_conditions)
		end
	end
end

mercurial