Fix a bug that occurs when userscript doesn't have all 3 modifiers

This commit is contained in:
Gnome Ann
2021-12-13 11:50:10 -05:00
parent 34c52a1a23
commit ed9c2a4d52
2 changed files with 6 additions and 12 deletions

View File

@@ -12,27 +12,21 @@ local corescript = {}
function corescript.inmod()
for i = #koboldcore.userscripts, 1, -1 do
local userscript = koboldcore.userscripts[i]
if userscript.inmod ~= nil then
userscript.inmod()
end
userscript.inmod()
end
end
-- Run all the generation modifiers from top to bottom
function corescript.genmod()
for i, userscript in ipairs(koboldcore.userscripts) do
if userscript.genmod ~= nil then
userscript.genmod()
end
userscript.genmod()
end
end
-- Run all the generation modifiers from top to bottom
function corescript.outmod()
for i, userscript in ipairs(koboldcore.userscripts) do
if userscript.outmod ~= nil then
userscript.outmod()
end
userscript.outmod()
end
end