Place Filtered

by Shemp

Tired of inserters and chests stealing items when you place them? Press N before placing a building to switch to a version with the filters turned on. You can also switch to alternate starting modes of some other items.

Utilities
a month ago
2.0 - 2.1
537
Logistics Storage Blueprints

b [Fixed] Crash when accessing item health

a month ago

Crash when the placed item runs out (0.3.0)

In control.lua, tryRevive() reads item.health on line 177, but inv.find_item_stack returns nil when the player no longer has the item. The nil check is on line 181, after the read.

So if the item runs out of your inventory while the Place Filtered cursor is still in hand, the next placement crashes with “attempt to index a nil value”.

Fix: move local health = item.health inside the if item and item.count >= 1 then block (or add if not item then return end before it).

Thanks for the mod!

a month ago

Thanks very much for the report and identifying how to fix it, I don't know what I was thinking when I wrote that line. This should be fixed in 0.3.1.

For any users on Factorio 2.0, I will no longer be updating the 2.0 version of this mod (or any of my other mods) now that Factorio 2.1 is stable. If this matters to you, you can apply the fix provided by the OP.

15 days ago

thank you for the update

New response