This makes it easier to understand the error in cases of incorrect syntax or formatting at .conf files. (js already has this quoting). Fixes #9105
Showing the changes to player/lua/options.lua (1 of 1 file). Show all
Unified · Split
| @@ -15,14 +15,14 @@ local function typeconv(desttypeval, val) · 14 unmodified lines | ||
| 15 | 15 | elseif val == "no" then |
| 16 | 16 | val = false |
| 17 | 17 | else |
| 18 | − msg.error("Error: Can't convert " .. val .. " to boolean!") | |
| 18 | + msg.error("Error: Can't convert '" .. val .. "' to boolean!") | |
| 19 | 19 | val = nil |
| 20 | 20 | end |
| 21 | 21 | elseif type(desttypeval) == "number" then |
| 22 | 22 | if not (tonumber(val) == nil) then |
| 23 | 23 | val = tonumber(val) |
| 24 | 24 | else |
| 25 | − msg.error("Error: Can't convert " .. val .. " to number!") | |
| 25 | + msg.error("Error: Can't convert '" .. val .. "' to number!") | |
| 26 | 26 | val = nil |
| 27 | 27 | end |
| 28 | 28 | end |
| @@ -92,7 +92,7 @@ local function read_options(options, identifier, on_update) · 63 unmodified lines | ||
| 92 | 92 | -- match found values with defaults |
| 93 | 93 | if option_types[key] == nil then |
| 94 | 94 | msg.warn(conffilename..":"..linecounter.. |
| 95 | − " unknown key " .. key .. ", ignoring") | |
| 95 | + " unknown key '" .. key .. "', ignoring") | |
| 96 | 96 | else |
| 97 | 97 | local convval = typeconv(option_types[key], val) |
| 98 | 98 | if convval == nil then |