1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-03-03 14:53:01 +02:00

Updated pollution multiplier commands

- Changed so that both can be run from server
- Gave regulars the ability to query the current pollution settings.
This commit is contained in:
Jayefuu 2021-02-19 14:51:53 +00:00
parent 21be255763
commit ddc234cfec

View File

@ -1219,6 +1219,8 @@ local function do_artillery_turrets_targets()
end
end
local server_player = {name = '<server>', print = print}
local function set_pollution_multiplier(args, player)
local multiplier = tonumber(args.multiplier)
if not multiplier then
@ -1226,6 +1228,7 @@ local function set_pollution_multiplier(args, player)
return
end
player = player or server_player
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
@ -1236,7 +1239,6 @@ local function set_pollution_multiplier(args, player)
end
end
local server_player = {name = '<server>', print = print}
local function get_pollution_multiplier(_, player)
player = player or server_player
player.print('Current pollution multiplier is: '..pollution_multiplier.value)
@ -1953,7 +1955,7 @@ Command.add(
'get-pollution-multiplier',
{
description = {'command_description.get_pollution_multiplier'},
required_rank = Ranks.admin,
required_rank = Ranks.regular,
capture_excess_arguments = true,
allowed_by_server = true
},