mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-24 10:32:56 +00:00
[Lua] Avoid missing field warning by reversing the order of the check
This commit is contained in:
parent
9e79a627c3
commit
faaeaadaa1
@ -188,10 +188,10 @@ wml.tag = setmetatable({}, create_tag_mt)
|
||||
---@param cfg WML
|
||||
---@return WMLTable
|
||||
function wml.literal(cfg)
|
||||
if type(cfg) == "userdata" then
|
||||
return cfg.__literal
|
||||
else
|
||||
if type(cfg) == "table" then
|
||||
return cfg or {}
|
||||
else
|
||||
return cfg.__literal
|
||||
end
|
||||
end
|
||||
|
||||
@ -201,10 +201,10 @@ end
|
||||
---@param cfg WML
|
||||
---@return WMLTable
|
||||
function wml.parsed(cfg)
|
||||
if type(cfg) == "userdata" then
|
||||
return cfg.__parsed
|
||||
else
|
||||
if type(cfg) == "table" then
|
||||
return cfg or {}
|
||||
else
|
||||
return cfg.__parsed
|
||||
end
|
||||
end
|
||||
|
||||
@ -214,10 +214,10 @@ end
|
||||
---@param cfg WML
|
||||
---@return WMLTable
|
||||
function wml.shallow_literal(cfg)
|
||||
if type(cfg) == "userdata" then
|
||||
return cfg.__shallow_literal
|
||||
else
|
||||
if type(cfg) == "table" then
|
||||
return cfg or {}
|
||||
else
|
||||
return cfg.__shallow_literal
|
||||
end
|
||||
end
|
||||
|
||||
@ -228,10 +228,10 @@ end
|
||||
---@param cfg WML
|
||||
---@return WMLTable
|
||||
function wml.shallow_parsed(cfg)
|
||||
if type(cfg) == "userdata" then
|
||||
return cfg.__shallow_parsed
|
||||
else
|
||||
if type(cfg) == "table" then
|
||||
return cfg or {}
|
||||
else
|
||||
return cfg.__shallow_parsed
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user