RELEASE 2.0.1 - Correctly skip spamming non-nauvis
authorSomeone <someone@somenet.org>
Sun, 27 Oct 2024 01:07:36 +0000 (02:07 +0100)
committerSomeone <someone@somenet.org>
Sun, 27 Oct 2024 01:07:36 +0000 (02:07 +0100)
changelog.txt
control.lua
info.json

index 9cc6f8d5b947232a176f2e67b0d924065e8bafcb..f54abea24e9e0028ed2089ee2d4295f9a44fa220 100644 (file)
@@ -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
index f23d52f8e73506c436506835e0ca8cbfa70cdda9..621ed4cb0b63a2e1a78320be7c6aeb429909dd99 100644 (file)
@@ -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
index deabd8e89dce5bca868bbc6fbd99d42fb603ea4e..27ff1b9bec019800abe4ef3a4c0a86323468b722 100644 (file)
--- 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",