Induction Charging deprecated

by Raeon

Power your equipment grid whilst in range of power poles, albeit at a price.

Content
3 years ago
1.1
22.0K
Armor

b Crash when used with Jetpack

3 years ago

Every now and then I get this error while taking off with the Jetpack.

The mod Induction Charging (2.0.2) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Induction Charging::on_tick (ID 0)
LuaEquipmentGrid API call when LuaEquipmentGrid was invalid.
stack traceback:
    [C]: in function '__index'
    __Induction Charging__/control.lua:223: in function 'updateTracker'
    __Induction Charging__/control.lua:287: in function <__Induction Charging__/control.lua:272>
2 years ago

maybe-related error, different details. Using Nullius and Jetpack. It reports:
The mod Induction Charging (2.0.2) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Induction Charging::on_tick (ID 0)
LuaEquipmentGrid API call when LuaEquipmentGrid was invalid.
stack traceback:
[C]: in function 'index'
__Induction Charging
/control.lua:223: in function 'updateTracker'
Induction Charging/control.lua:287: in function <Induction Charging/control.lua:272>

2 years ago

A quick sanity check added to control.lua seems to fix this problem

local function updateTracker(tracker)
if not tracker.entity.valid then
deleteTracker(tracker.entity)
return
end
local grid = tracker.grid

-- EDIT (Fix Jetpack crash)
if not grid.valid then
    return
end
-- END EDIT

New response