When portals are closed, if the gate layout is changed, weird things happen #15
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: EpicKnarvik97/Stargate#15
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If the gate layout is changed, the gate-open and gate-closed materials will still overwrite regardless if the gate no longer matches the layout at all. It can cause really weird and broken results. Part of the border may be replaced with the portal-open and portal-closed blocks.
If the button is relocated, a new button is generated. On reload, the old button is still the registered one. On restart, the new button is the working one.
Haven't really found out why this happens just yet. Everything should be removed and then loaded from disk.
I'm guessing it firstly happens when loading a portal: PortalFileHelper::loadPortal. I'm not sure which approach is the best. One option would to make portal verification mandatory, as the portals would not be loaded because of the mismatch. Another option would be to invalidate it if the layout itself is changed. No material checks, just check if the layout matrices are identical.
It seems like the button bug is caused by lookupBlocks not being updated, though I cannot find a reason why it wouldn't be.
While the button stuff seems to work fine now, I don't know how to fix the open-block and closed-block overwriting the frame of the portal. If gate verification is enabled, there is no problem, since the gates will be unregistered and untouched.
If gate verification is disabled, however, the portal's open and closed blocks overwrites anything, even the frame. I'm not sure if there is a way to fix this, maybe except checking if any border blocks are air as a kind of soft validation if validation is disabled.