diff --git a/Makefile b/Makefile index fddf6a9..96f6f08 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ PACKAGE_NAME := Big_Brother -VERSION_STRING := 0.2.2 +VERSION_STRING := 0.2.3 OUTPUT_NAME := $(PACKAGE_NAME)_$(VERSION_STRING) OUTPUT_DIR := build/$(OUTPUT_NAME) diff --git a/control.lua b/control.lua index bfef708..8ec958f 100644 --- a/control.lua +++ b/control.lua @@ -88,17 +88,19 @@ end) Event.register(defines.events.on_research_finished, function(event) local tech_name = event.research.name + local force = event.research.force if tech_name:starts_with('radar-amplifier') or tech_name:starts_with('radar-efficiency') then -- update radars in 1 tick - local force = event.research.force Event.register(defines.events.on_tick, function(event) upgrade_radars(force) - Event.remove(defines.events.on_tick, event._handler) end) elseif tech_name == 'surveillance-2' then if global.power_poles and global.surveillance_centers then - update_all_surveillance(event.research.force) + Event.register(defines.events.on_tick, function(event) + update_all_surveillance(force) + Event.remove(defines.events.on_tick, event._handler) + end) end end end)