Jump to content

Non-automatic migration portal links turns automatic when opening cave_entrance (patch included)


chaosmonkey
  • Pending

Hello!

I've been working on setting up a multi-shard world with "hardcoded" migration portals (ie worldmigrator:SetDestinationWorld, worldmigrator:SetReceivedPortal), and there is a bug when doing so with `cave_entrance` prefabs. When mining the cave entrance, the `worldmigator.auto` flag is lost, and the linkage becomes automatic. This causes the received portal to abruptly change after a server restart.

I believe this is a one line fix in cave_entrance.lua in the OnWork function. Sorry in advance for the lack of a proper diff, I'm writing this up on windows without real tooling.

Here's the existing code which copies the link data

        openinst.components.worldmigrator.id = inst.components.worldmigrator.id
        openinst.components.worldmigrator.linkedWorld = inst.components.worldmigrator.linkedWorld
        openinst.components.worldmigrator.receivedPortal = inst.components.worldmigrator.receivedPortal

It's missing one line,

        openinst.components.worldmigrator.auto = inst.components.worldmigrator.auto

which I believe should allow the linkage to remain as desired.


Steps to Reproduce

Set up a linked migration portal using <cave_entrance prefab>:worldmigrator:SetDestinationWorld and :SetReceivedPortal(n, true). Set up the other side of the linkage from the corresponding cave_exit prefab. Head back to the cave_entrance and mine it. You should be able to go back and forth through the portal at this point. Now, restart the server, or simply stop it and inspect the session data, and observe the new cave_entrance_open prefab having auto=true instead of auto=false, as was the intent.

  • Big Ups 1



User Feedback




Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...