even-distribution icon indicating copy to clipboard operation
even-distribution copied to clipboard

DyWorld-Dynamic's burner radar causes crash when distributing items to it

Open Atria1234 opened this issue 3 years ago • 0 comments

DyWorld-Dynamic mod introduces new radar which burns carbon fuel for it to run.

So entity:inventory("fuel") at https://github.com/321freddy/even-distribution/blob/master/scripts/cleanup.lua#L267 returns nil and then is accessed right away, causing Lua's equivalent of Null pointer exception.

After some debugging I found that entity.get_inventory("fuel") returns actual inventory while entity.get_fuel_inventory() returns nil. It appears to be bug in Factorio, but fast fix for this mod would be to use entity.get_inventory(defines.inventory.fuel) on line https://github.com/321freddy/even-distribution/blob/master/scripts/helpers/LuaControl.lua#L67

Atria1234 avatar Dec 31 '21 06:12 Atria1234