mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 01:47:13 +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
|
---@param cfg WML
|
||||||
---@return WMLTable
|
---@return WMLTable
|
||||||
function wml.literal(cfg)
|
function wml.literal(cfg)
|
||||||
if type(cfg) == "userdata" then
|
if type(cfg) == "table" then
|
||||||
return cfg.__literal
|
|
||||||
else
|
|
||||||
return cfg or {}
|
return cfg or {}
|
||||||
|
else
|
||||||
|
return cfg.__literal
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -201,10 +201,10 @@ end
|
|||||||
---@param cfg WML
|
---@param cfg WML
|
||||||
---@return WMLTable
|
---@return WMLTable
|
||||||
function wml.parsed(cfg)
|
function wml.parsed(cfg)
|
||||||
if type(cfg) == "userdata" then
|
if type(cfg) == "table" then
|
||||||
return cfg.__parsed
|
|
||||||
else
|
|
||||||
return cfg or {}
|
return cfg or {}
|
||||||
|
else
|
||||||
|
return cfg.__parsed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -214,10 +214,10 @@ end
|
|||||||
---@param cfg WML
|
---@param cfg WML
|
||||||
---@return WMLTable
|
---@return WMLTable
|
||||||
function wml.shallow_literal(cfg)
|
function wml.shallow_literal(cfg)
|
||||||
if type(cfg) == "userdata" then
|
if type(cfg) == "table" then
|
||||||
return cfg.__shallow_literal
|
|
||||||
else
|
|
||||||
return cfg or {}
|
return cfg or {}
|
||||||
|
else
|
||||||
|
return cfg.__shallow_literal
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -228,10 +228,10 @@ end
|
|||||||
---@param cfg WML
|
---@param cfg WML
|
||||||
---@return WMLTable
|
---@return WMLTable
|
||||||
function wml.shallow_parsed(cfg)
|
function wml.shallow_parsed(cfg)
|
||||||
if type(cfg) == "userdata" then
|
if type(cfg) == "table" then
|
||||||
return cfg.__shallow_parsed
|
|
||||||
else
|
|
||||||
return cfg or {}
|
return cfg or {}
|
||||||
|
else
|
||||||
|
return cfg.__shallow_parsed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user