Commit 3a1f2d0f7b6f42a7335447e7ea449d74836aa5e1

Authored by DarkGod
1 parent 16ccca38

plop

... ... @@ -586,7 +586,7 @@ function _M:loadAddons(mod, saveuse)
586 586 print("Removing addon "..add.short_name..": not allowed by config")
587 587 table.remove(adds, i) removed = true
588 588 end
589   - elseif not config.settings.cheat and not engine.beta_allow_addon(add.short_name) then
  589 + elseif not config.settings.cheat and not engine.beta_allow_addon(add) then
590 590 print("Removing addon "..add.short_name..": game beta forbids")
591 591 table.remove(adds, i) removed = true
592 592 beta_removed[#beta_removed+1] = add.long_name
... ...
... ... @@ -116,13 +116,14 @@ function engine.version_hasbeta()
116 116 end
117 117
118 118 --- Check if we are running as beta
119   -function engine.beta_allow_addon(name)
  119 +function engine.beta_allow_addon(add)
120 120 if fs.exists("/engine/version_beta.lua") then
121 121 local beta, allowed_addons = dofile("/engine/version_beta.lua")
122 122 if not beta or not allowed_addons then return true end
123 123 for _, test in ipairs(allowed_addons) do
124   - if name == test then return true
125   - elseif name:find(test) then return true end
  124 + if type(test) == "function" then return test(add)
  125 + elseif add.short_name == test then return true
  126 + elseif add.short_name:find(test) then return true end
126 127 end
127 128 else
128 129 return true
... ...
1 1 #!/bin/sh
2 2
3 3 if test $# -lt 1 ; then
4   - echo "Usage: release.sh [version] [beta, if any] [allowed addons, if beta]"
  4 + echo "Usage: release.sh [version] [beta, if any] [if beta, allowed addons list or 'all' or 'no-dlc' or 'with-dlc']"
5 5 exit
6 6 fi
7 7
... ... @@ -70,15 +70,19 @@ echo "version_desc = '$ver'" >> game/engines/default/modules/boot/init.lua
70 70 echo "version_desc = '$ver'" >> game/modules/tome/init.lua
71 71 if test -n "$beta"; then
72 72 if test $# -lt 3 ; then
73   - echo "Usage: release.sh [version] [beta] [allowed addons or 'all']"
  73 + echo "Usage: release.sh [version] [beta] [allowed addons list or 'all' or 'no-dlc' or 'with-dlc']"
74 74 exit
75 75 fi
76 76 addons="$3"
77 77 if test "$addons" = "all"; then
78 78 echo "return '$beta'" > game/engines/default/engine/version_beta.lua
  79 + elif test "$addons" = "no-dlc"; then
  80 + echo "return '$beta', "'{"possessors", "items-vault", "^cosmetic%-shimmer%-.+"}' > game/engines/default/engine/version_beta.lua
  81 + elif test "$addons" = "with-dlc"; then
  82 + echo "return '$beta', "'{"possessors", "items-vault", "^cosmetic%-shimmer%-.+", function(add) return add.id_dlc end}' > game/engines/default/engine/version_beta.lua
79 83 else
80 84 addons_check=`echo "$addons" | sed -e 's/\([^,]\+\)/"\1"/g' -e 's/^/{/' -e 's/$/}/'`
81   - echo "return '$beta' '$addons_check'" > game/engines/default/engine/version_beta.lua
  85 + echo "return '$beta', '$addons_check'" > game/engines/default/engine/version_beta.lua
82 86 fi
83 87 fi
84 88
... ...