Oarc Multiplayer Spawn

by Oarc

Provides a better multiplayer experience by allowing players to have separate spawns around the map. This mod provides a custom spawn system for multiplayer co-operative play. The goal is to provide as close to a vanilla experience as possible (while also supporting compatibility with other mods where possible.) [Now supports all the new planets in Space Age!]

Utilities
3 months ago
0.17 - 2.1
7.58K
Enemies Environment

g Crash when space platforms share resources

14 days ago
(updated 14 days ago)

Mod works great until your space platforms send resources from one to another. Here's the crash:

The mod Oarc Multiplayer Spawn (2.1.25) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event oarc-mod::on_tick (ID 0)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
    [C]: in function '__index'
    __oarc-mod__/lib/separate_spawns.lua:1859: in function 'CargoPodHandlerOnTick'
    __oarc-mod__/control.lua:280: in function <__oarc-mod__/control.lua:265>

We're on the latest factorio experimental 2.1.19. I saw the note that the author is not maintaining the mod anymore, but just in case someone picks it up...

13 days ago
(updated 13 days ago)

Thanks for the report! Yeah someone else pinged me with a fix for this awhile back but I never got time to implement it. I'll try to push an update if I can.

Here's the proposed fix if you want to try it yourself.
(The error should point you to the source file).

for index, pod in pairs(storage.cargo_pods) do

+        -- Pods sent from one platform to another land on a platform and are destroyed there,
+        -- so they never pass through the "surface without a platform" state below. The stored
+        -- entity reference becomes invalid and any API call on it would crash the game.
+        if (not pod.valid) then
+            storage.cargo_pods[index] = nil
+
         -- Make sure the pod is now descending, which means the surface shouldn't have a platform.
-        -- This will likely break in the future if there is a way to send platform to platform.
-        if (pod.surface.platform == nil) then
+        elseif (pod.surface.platform == nil) then
             local surface = pod.surface
             local force = pod.force

New response