core.lua: Link to #4584 in a comment near the new warning

This commit is contained in:
jostephd 2019-11-22 19:19:53 +00:00 committed by GitHub
parent 74c7c17ec8
commit 4b3a7c0800
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -202,6 +202,7 @@ function wesnoth.deprecate_api(elem_name, replacement, level, version, elem, det
-- Don't clobber the old metatable.
local old_mt = getmetatable(elem) or {}
if type(old_mt) ~= "table" then
-- See https://github.com/wesnoth/wesnoth/issues/4584#issuecomment-555788446
wesnoth.log('warn', "Attempted to deprecate a table with a masked metatable: " ..
elem_name .. " -> " .. replacement .. ", where getmetatable(" .. elem_name .. ") = " .. tostring(old_mt))
return elem