feat(nukeprotect): disable nukes completely on config

This commit is contained in:
oof2win2
2023-09-06 20:42:25 +02:00
parent 7d5254f44e
commit 266e7f2a4b
2 changed files with 18 additions and 4 deletions

View File

@@ -1,9 +1,9 @@
--- Disable new players from having certain items in their inventory, most commonly nukes
-- @addon Nukeprotect
local Event = require 'utils.event' --- @dep utils.event
local Roles = require 'expcore.roles' --- @dep expcore.roles
local config = require 'config.nukeprotect' --- @dep config.nukeprotect
local Event = require 'utils.event' --- @dep utils.event
local Roles = require 'expcore.roles' --- @dep expcore.roles
local config = require 'config.nukeprotect' --- @dep config.nukeprotect
local move_items_stack = _C.move_items_stack --- @dep expcore.common
@@ -34,3 +34,13 @@ for _, inventory in ipairs(config.inventories) do
end)
end
end
if config.disable_nuke_research then
Event.add(defines.events.on_research_started, function(event)
local name = event.research.name
if config.disable_nuke_research_names[name] then
event.research.force.cancel_current_research()
end
end)
end