multi-events compatibility with lua metatables broken
MR !43 (merged) fixed a bug with how the multi-events script handles metatable events, but the fix only worked with metatables created by the solarus engine. It does not work with lua created metatables via setmetatable()
. The old version of the multi-events script did handle lua created metatables correctly, so the revised script is no longer backwards compatible.
The multi-events script should be revised to also work properly with lua-created metatables. Also create a test-case for this scenario.
Note: the discrepancy is due to the fact that a solarus created metatable is obtained via:
local meta = getmetatable(hero)
whereas for lua-based metatables it is different:
local meta = getmetatable(menu).__index