Skip to content

Commit

Permalink
TweakOptions: Show error and loaded tweakdefs (#1248)
Browse files Browse the repository at this point in the history
  • Loading branch information
badosu authored Sep 13, 2022
1 parent c7cd560 commit 79223f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gamedata/unitdefs_post.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,15 @@ local function preProcessTweakOptions()
while modOptions[name] and modOptions[name] ~= "" do
local postsFuncStr = string.base64Decode(modOptions[name])
local postfunc, err = loadstring(postsFuncStr)
if err then
Spring.Echo("Error parsing modoption", name, "from string", postsFuncStr)
if err then
Spring.Echo("Error parsing modoption", name, "from string", postsFuncStr, "Error: " .. err)
else

Spring.Echo("Loading tweakdefs modoption", append or 0)
Spring.Echo(postsFuncStr)
if postfunc then
local success, result = pcall(postfunc)
if not success then
Spring.Echo("Error executing tweakdef", name, postsFuncStr)
if not success then
Spring.Echo("Error executing tweakdef", name, postsFuncStr, "Error :" .. result)
end
end
append = (append or 0) + 1
Expand Down

0 comments on commit 79223f8

Please sign in to comment.