troelsbjerre / Bottleneck

Factorio mod that tell you which assemblers are starved of ingredients
Other
29 stars 21 forks source link

Script raised revive causing crash #51

Closed Klonan closed 5 years ago

Klonan commented 5 years ago

https://github.com/troelsbjerre/Bottleneck/blob/f6f19c1a35b29bd10421e0760d81007a7e3c18f4/control.lua#L168

Your event looks for created_entity.

However the base game sends script raised revive with just entity: https://lua-api.factorio.com/latest/events.html#script_raised_revive

Which causes your script to crash if someone calls entity.revive().


The fix is simple, change it to:

local entity = event.created_entity or event.entity
troelsbjerre commented 5 years ago

Thanks. Fixed, pushed, and released as 0.10.3