Shield Generators


Adds turret shields and shield generators for civil structures.

Content
3 months ago
1.1 - 2.0
32.9K
Combat

b Repair Turret Conflict

5 months ago

Conflict with Repair_Turret_2.0.3 Hide Path map config!
And something else MAYBE (200 mods loaded........)

113.634 Error MainLoop.cpp:1449: Exception at tick 22964075: The mod Shield Generators (0.4.2) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event shield-generators::on_tick (ID 0)
LuaRenderObject API call when LuaRenderObject was invalid.
stack traceback:
[C]: in function 'newindex'
__shield-generators
/control.lua:590: in function 'set_right_bottom'
shield-generators/control.lua:667: in function <shield-generators/control.lua:594>

Fix:

From
control.lua line 588

function set_right_bottom(renderable, entity)
    loadable.entity = entity
    renderable.right_bottom = loadable
end

end

To:

function set_right_bottom(renderable, entity)
    if renderable and renderable.valid then
        loadable.entity = entity
        renderable.right_bottom = loadable
    end
end

AND
control.lua line 1305

if not data.battery_bar or not not data.battery_bar.valid then

To

if not data.battery_bar or not data.battery_bar.valid then

Srr for noob code mistakes from me....

5 months ago

Adding valid check inside rendering code will just "fix" symptoms and not the cause, and also slowdown everything for no reason (because renderables should not spontaneously become invalid)

New response