From ddc63d2e23915fbdc807d8199c80936a16a16c70 Mon Sep 17 00:00:00 2001 From: Someone Date: Sun, 27 Oct 2024 02:07:36 +0100 Subject: [PATCH] RELEASE 2.0.1 - Correctly skip spamming non-nauvis --- changelog.txt | 7 +++++++ control.lua | 5 ++--- info.json | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 9cc6f8d..f54abea 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +--------------------------------------------------------------------------------------------------- +Version: 2.0.1 +Date: 2024-10-27 + + Changed: + - Correctly skip spamming non-nauvis. + --------------------------------------------------------------------------------------------------- Version: 2.0.0 Date: 2024-10-21 diff --git a/control.lua b/control.lua index f23d52f..621ed4c 100644 --- a/control.lua +++ b/control.lua @@ -1,9 +1,8 @@ -- Iterate over every tile in the new chunk and spam with random resources, if empty and possible. script.on_event(defines.events.on_chunk_generated, function (event) -- this mod is intended as an early game challenge. Therefore do nothing on non-nauvis. - if not event.surface.planet.name == "nauvis" then - return - end + if not event.surface.planet then return end + if not event.surface.planet.name ~= "nauvis" then return end -- prevent one big continuous patch if (event.area.left_top.x/32)%10 == 5 or (event.area.left_top.y/32)%10 == 5 then diff --git a/info.json b/info.json index deabd8e..27ff1b9 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "some-resourcespam", - "version": "2.0.0", + "version": "2.0.1", "title": "Some resource spam", "author": "someone1337", "homepage": "https://git.somenet.org/factorio/some-resourcespam.git", -- 2.43.0