Skip to content

Commit

Permalink
Allow data.extend to work for mods that use that
Browse files Browse the repository at this point in the history
Wube has some code in data.extend to allow mods to use either data:extend
or data.extend. Someone found a mod that does this today, this adds
compatibility with mods like that in melonlib.
  • Loading branch information
Septiple committed Dec 31, 2024
1 parent bf8b4e5 commit 1cff6cd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/metas/metas.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ end

local extend = data.extend
data.extend = function(self, prototypes)
-- Wube made it so data:extend and data.extend are the same
if self ~= prototypes and prototypes == nil then
prototypes = self
end
extend(self, prototypes)
for _, prototype in pairs(prototypes) do
local meta = metas[prototype.type]
Expand Down

0 comments on commit 1cff6cd

Please sign in to comment.