mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
This is just a bandaid to fix a symptom. The underlying cause is still there, but at least it shouldn't spam the players anymore.
27 lines
983 B
Lua
27 lines
983 B
Lua
|
|
local function updateTech()
|
|
script.raise_event(defines.events.on_research_finished, {research=game.forces['player'].technologies['{tech_name}'], by_script=true})
|
|
if {notify} then
|
|
if 1 == {tech_infinite} then
|
|
game.print("Infinite technology {tech_name} level {tech_level} unlocked")
|
|
else
|
|
game.print("Technology {tech_name} researched")
|
|
end
|
|
game.play_sound({path="utility/research_completed"})
|
|
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
|