mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-24 08:23:12 +09:00
Merge pull request #186 from Zeroto/master
Fix notifying about the same research being finished
This commit is contained in:
1 file changed
+15
-6
@@ -1,10 +1,5 @@
|
|||||||
|
|
||||||
if game.forces['player'].technologies['{tech_name}'] then
|
local function updateTech()
|
||||||
if 1 == {tech_infinite} then
|
|
||||||
game.forces['player'].technologies['{tech_name}'].level = {tech_level}
|
|
||||||
else
|
|
||||||
game.forces['player'].technologies['{tech_name}'].researched = true
|
|
||||||
end
|
|
||||||
script.raise_event(defines.events.on_research_finished, {research=game.forces['player'].technologies['{tech_name}'], by_script=true})
|
script.raise_event(defines.events.on_research_finished, {research=game.forces['player'].technologies['{tech_name}'], by_script=true})
|
||||||
if {notify} then
|
if {notify} then
|
||||||
if 1 == {tech_infinite} then
|
if 1 == {tech_infinite} then
|
||||||
@@ -15,3 +10,17 @@ if game.forces['player'].technologies['{tech_name}'] then
|
|||||||
game.play_sound({path="utility/research_completed"})
|
game.play_sound({path="utility/research_completed"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if game.forces['player'].technologies['{tech_name}'] then
|
||||||
|
if 1 == {tech_infinite} then
|
||||||
|
if (game.forces['player'].technologies['{tech_name}'].level ~= level) then
|
||||||
|
game.forces['player'].technologies['{tech_name}'].level = {tech_level}
|
||||||
|
updateTech()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if not game.forces['player'].technologies['{tech_name}'].researched then
|
||||||
|
game.forces['player'].technologies['{tech_name}'].researched = true
|
||||||
|
updateTech()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in new issue
Block a user