Abandoned Ruins - Updated (core)

by Keysivi

This mod doesn't do anything by itself. You need to install ruin-set mods or no ruin will be spawned. It then can spawn randomly choosen ruins in the world. These ruins are destroyed fragments of bases, forts, small oases, and more. (Now co-authored with roland77)

Content
5 days ago
2.0
4.50K

b [FIXED] Ruins can have no entities but you are blocking them

a month ago
    if ruin.entities == nil then
      game.print(string.format("Won't spawn a ruin at '%s' as no entities are included. Please report this to your ruin-set developer!", surface.name))
      return
    end

For some reason you are blocking ruins that consist only of tiles. This affects even Base ruin set.

a month ago

This is a small leftover from rewrites of old code. spawn_entities() previously allowed its first parameter entities to be nil and just returned silently. I'm against such principle, that when a function is invoked, all conditions are correct. The main purpose of spawn_entities() is ... to spawn entities. So at least one should be around.

I can rewrite this code part to only invoke that function as I saw one ruin in "base" ruin-set myself having no entities, but tiles. I have now expanded all these condition checks (variables first, then entities and tiles) by not only checking if it isn't nil but also contains at least one item in it. 1.3.7 will address this issue.

This thread has been locked.