Version: Repair Turret 2 1.3.0
What happened: While the turrets were upgrading a large number of belts and other entities, the game crashed with this error:
Error while running event Repair_Turret_2::on_tick (ID 0)
Target must have health.
stack traceback:
[C]: in function 'create_entity'
Repair_Turret_2/script/repair_turret.lua:2580: in function 'try_upgrade_entity'
Repair_Turret_2/script/repair_turret.lua:757: in function 'check_target'
Repair_Turret_2/script/repair_turret.lua:1076: in function 'update'
Repair_Turret_2/script/repair_turret.lua:3077: in function 'check_turret_update'
Repair_Turret_2/script/repair_turret.lua:3355: in function 'handler'
I added a log line just before the create_entity call in try_upgrade_entity that prints new_entity: log("RT2 upgrade target: " .. tostring(new_entity and new_entity.name) .. " (type: " .. tostring(new_entity and new_entity.type) .. ")")
The last line before the crash was:
RT2 upgrade target: advanced-construct-beam (type: beam)