Skip to content

Commit

Permalink
Fixed multiple melonlib functions still check for .expensive and .nor…
Browse files Browse the repository at this point in the history
…mal. Resolves pyanodon/pybugreports#773
  • Loading branch information
notnotmelon committed Jan 16, 2025
1 parent 35facce commit 4f98f3e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 31 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 3.0.22
Date: ?
Changes:
- Fixed multiple melonlib functions still check for .expensive and .normal. Resolves https://github.com/pyanodon/pybugreports/issues/773
---------------------------------------------------------------------------------------------------
Version: 3.0.21
Date: 2025-1-2
Changes:
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pypostprocessing",
"version": "3.0.21",
"version": "3.0.22",
"factorio_version": "2.0",
"title": "Pyanodons Post-processing",
"author": "Pyanodon, Shadowglass",
Expand Down
12 changes: 0 additions & 12 deletions lib/metas/recipe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,6 @@ RECIPE = setmetatable(data.raw.recipe, {
})

metas.standardize = function(self)
if self.normal then
for k, v in pairs(self.normal) do
if not self[k] then self[k] = v end
end
elseif self.expensive then
for k, v in pairs(self.expensive) do
if not self[k] then self[k] = v end
end
end
self.normal = nil
self.expensive = nil

if self.results and type(self.results) == "table" then
self.result = nil
self.result_count = nil
Expand Down
19 changes: 1 addition & 18 deletions lib/metas/technology.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,7 @@ TECHNOLOGY = setmetatable(data.raw.technology, {
local metas = {}

metas.standardize = function(self)
if self.normal then
for k, v in pairs(self.normal) do
if not self[k] then self[k] = v end
end
elseif self.expensive then
for k, v in pairs(self.expensive) do
if not self[k] then self[k] = v end
end
end

-- unit is not mandatory is 2.0
-- if not self.unit then self.unit = {ingredients = {}} end

--TODO: See if SA launch version still requires the shorthand spec
--[[
for k, p in pairs(self.unit.ingredients) do
self.unit.ingredients[k] = py.standardize_product(p)
end]]
if not self.unit then self.unit = {ingredients = {}} end

self.prerequisites = self.prerequisites or {}
self.dependencies = self.dependencies or {}
Expand Down

0 comments on commit 4f98f3e

Please sign in to comment.