Skip to content

Commit

Permalink
Fixed crash when paired with the editor extensions mod.
Browse files Browse the repository at this point in the history
  • Loading branch information
notnotmelon committed Oct 21, 2024
1 parent 2c25ddb commit c7c4bfa
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
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.4
Date: 2024-10-21
Changes:
- Fixed crash when paired with the editor extensions mod.
---------------------------------------------------------------------------------------------------
Version: 3.0.3
Date: 2024-10-21
Changes:
Expand Down
2 changes: 2 additions & 0 deletions data-final-fixes.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "prototypes.quality"

local dev_mode = settings.startup["pypp-dev-mode"].value
local create_cache_mode = settings.startup["pypp-create-cache"].value
local config = require "prototypes.config"
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.3",
"version": "3.0.4",
"factorio_version": "2.0",
"title": "Pyanodons Post-processing",
"author": "Pyanodon, Shadowglass",
Expand Down
27 changes: 27 additions & 0 deletions prototypes/quality.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
if not mods.quality then return end

local deadrecipes = {}
for r, recipe in pairs(data.raw.recipe) do
if string.match(recipe.name, "recycling") ~= nil then
if data.raw.item[recipe.ingredients[1].name] == nil or data.raw.item[recipe.results[1].name] == nil then
table.insert(deadrecipes, recipe.name)
end
end
end

for r, recipe in pairs(deadrecipes) do
log("WARNING @ quality.lua: Deleting quality recycling recipe " .. recipe)
data.raw.recipe[recipe] = nil
end
local deadrecipes = {}

for t, tech in pairs(data.raw.technology) do
for e, effect in pairs(tech.effects or {}) do
if effect.type == "unlock-recipe" then
if data.raw.recipe[effect.recipe] == nil then
log("WARNING @ quality.lua " .. tech.name .. ": Recipe unlock effect " .. effect.recipe .. " does not exist!")
data.raw.technology[tech.name].effects[e] = nil
end
end
end
end

0 comments on commit c7c4bfa

Please sign in to comment.