Skip to content

Commit

Permalink
Fix researching surveillance-2 not immediately unlocking extra survei…
Browse files Browse the repository at this point in the history
…llance
  • Loading branch information
Afforess committed May 11, 2016
1 parent eb89cf3 commit 265a8b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
8 changes: 5 additions & 3 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 265a8b2

Please sign in to comment.