renoth / factorio-alien-module

A mod for factorio
MIT License
14 stars 16 forks source link

Crash when biters are killed not by player #93

Closed AndyScull closed 3 months ago

AndyScull commented 5 months ago

I was checking if maybe if would be possible to add Armored/Frost/Explosive/Toxic biters to the mod. Frost biters leave a damaging cold cloud after their death, which can kill vanilla biters if they run through it. If the biter dies in this way, crash with error, I suspect the mod tries to add kill count to non-existing force.

The mod Alien Loot Economy (1.4.5) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event alien-module::on_entity_died (ID 4)
__alien-module__/control.lua:368: attempt to perform arithmetic on field '?' (a nil value)
stack traceback:
    __alien-module__/control.lua:368: in function <__alien-module__/control.lua:365>
renoth commented 5 months ago

can you try with 1.4.7?

AndyScull commented 5 months ago

Did you commit it? The repository shows 1.4.6 as current. So far, I managed to disable this with killcount check, not very foolproof but it allows me to test other things with these biter mods

if (event.entity.type == "unit" and event.entity.force.name == "enemy" and global.killcount[forceName] ~= nil) then