Vehicle Deployer

by fgardt

Automate the deployment of your vehicles by using a vehicle deployer.

Content
a year ago
1.1
226
Transportation

b [FIXED] Error caused by entity_destroyed event

1 year, 8 months ago

The mod Vehicle deployer (1.0.2) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event vehicle-deployer::on_entity_destroyed (ID 159)
vehicle-deployer/control.lua:58: table index is nil
stack traceback:
vehicle-deployer/control.lua:58: in function <vehicle-deployer/control.lua:57>

1 year, 8 months ago

I have come up with a solution but I'm not 100% sure that it won't have unintended side effects.
On line 57 of control.lua, the following function can be modified so that unit_number is checked prior to using the value as an array index.

script.on_event(ev.on_entity_destroyed, function(event)
global.deployers[event.unit_number] = nil
end)

to

script.on_event(ev.on_entity_destroyed, function(event)
if not event.unit_number == nil then
global.deployers[event.unit_number] = nil
end
end)

1 year, 3 months ago

This should now be fixed with v1.0.4. Thanks for reporting this and sorry for taking so long to finally fix this small issue.

1 year, 3 months ago

Does not seem to be fixed?

I just got this issue in my save too... without a single vehicle yet, when a furnace got replaced with a steel furnace by a bot. (using one of the quick start mods for early bots)

1 year, 3 months ago

factorio-current.txt trace:

331.974 Error MainLoop.cpp:1382: Exception at tick 1898056: The mod Vehicle deployer (1.0.4) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event vehicle-deployer::on_entity_destroyed (ID 160)
vehicle-deployer/control.lua:63: table index is nil
stack traceback:
vehicle-deployer/control.lua:63: in function <vehicle-deployer/control.lua:57>

1 year, 3 months ago

oh yeah thanks for reporting that. I accidentally made the condition the wrong way around.
should be fixed for real this time with v1.0.5

New response