From 4e4a1ccfb941135370cac50fee00a1b7ba8a5275 Mon Sep 17 00:00:00 2001 From: Brevven Date: Mon, 13 Jan 2025 21:36:40 -0800 Subject: [PATCH] fix regenerate without space age --- changelog.txt | 5 +++++ control-util.lua | 6 ++++-- info.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index f9261a2..c24493a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 2.0.3 +Date: 2025-01-14 + Changes: + - Fix /bz-regenerate command when not using Space Age +--------------------------------------------------------------------------------------------------- Version: 2.0.2 Date: 2025-01-09 Changes: diff --git a/control-util.lua b/control-util.lua index d744561..ef04e99 100644 --- a/control-util.lua +++ b/control-util.lua @@ -147,8 +147,10 @@ function regenerate_ore(event) for w in event.parameters:gmatch("%S+") do table.insert(params, w) end if #params == 1 and params[1] == "all" then for _, resource in pairs(me.resources) do - game.print("Regenerating "..resource) - game.regenerate_entity(resource) + if prototypes.entity[resource] then + game.print("Regenerating "..resource) + game.regenerate_entity(resource) + end end return end diff --git a/info.json b/info.json index fc82e9e..ad88d8f 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzsilicon", - "version": "2.0.2", + "version": "2.0.3", "factorio_version": "2.0", "title": "Silica & Silicon", "author": "Brevven",