Skip to content

Commit

Permalink
Merge pull request #1247 from Refactorio/pollution_multiplier_default…
Browse files Browse the repository at this point in the history
…_changes

Updated the starting pollution multiplier
  • Loading branch information
Jayefuu authored Sep 30, 2021
2 parents 1cd0e8a + 2276706 commit 3a31952
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion map_gen/maps/crash_site/outpost_builder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ local magic_fluid_crafters = {index = 1}
local outposts = {}
local artillery_outposts = {index = 1}
local outpost_count = 0
local pollution_multiplier = {value = 0}
local base_pollution_multiplier = 10
local pollution_multiplier = {value = 10}

Global.register(
{
Expand Down Expand Up @@ -1227,6 +1228,16 @@ local function set_pollution_multiplier(args, player)
return
end

if multiplier < base_pollution_multiplier then
if base_pollution_multiplier == pollution_multiplier.value then -- no change, so not necessary to message all admins and update the value
player.print("Magic crafter pollution is already at minimum value of " .. base_pollution_multiplier)
return
end
-- update the value to the minimum and continue to message all admins
player.print("Setting magic crafter pollution multiplier to the minimum value of " .. base_pollution_multiplier)
multiplier = base_pollution_multiplier
end

local old_multiplier = pollution_multiplier.value
pollution_multiplier.value = multiplier
local message = player.name..' changed magic crafter pollution multiplier from '..old_multiplier..' to '..pollution_multiplier.value
Expand Down

0 comments on commit 3a31952

Please sign in to comment.