Create setting to disallow crafting ATMs...

Only admins can add ATMs to game.
This commit is contained in:
Jordan Irwin 2021-04-25 03:16:52 -07:00
parent 14b773a5d7
commit ebc7e33ee7
5 changed files with 49 additions and 8 deletions

View File

@ -1617,6 +1617,11 @@ log_mods = true
# default: sfinv
inventory = sfinv
## Allow players to craft ATM machines.
# type: bool
# default: true
#allow_atm_craft = false
###########

View File

@ -1,19 +1,19 @@
--[[ LICENSE HEADER
MIT License
Copyright © 2017 Jordan Irwin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@ -21,11 +21,12 @@
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
--]]
local modoverrides = {
'atm',
'bags',
'biofuel',
'carts',
@ -43,9 +44,9 @@ local modoverrides = {
for index, modname in ipairs(modoverrides) do
if core.get_modpath(modname) then
if antum.verbose then
antum.logAction('DEBUG: found mod \"' .. modname .. '\"')
antum.logAction('Executing craft overrides for "' .. modname .. '" mod')
end
antum.loadScript('crafting/' .. modname)
end
end

View File

@ -0,0 +1,31 @@
--[[ LICENSE HEADER
MIT License
Copyright © 2017 Jordan Irwin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
--]]
if not core.settings:get_bool("allow_atm_craft", true) then
core.clear_craft({output="atm:atm"})
core.clear_craft({output="atm:wtt"})
end

View File

@ -2,6 +2,7 @@ antum
default
override
animalmaterials?
atm?
bags?
carts?
castle_weapons?

View File

@ -22,6 +22,9 @@ liquid_finite (Finite liquid) bool false
# Inventory interface to use.
inventory (Inventory interface) enum sfinv sfinv,inventory_plus
# Allow players to craft ATM machines.
allow_atm_craft (Allow ATM crafting) bool true
[*Mobiles (Mobs)]