Zytharian / RbxStargate

v20 of Stargates implemented on Roblox
MIT License
7 stars 3 forks source link

Edge case: An undialable address is created when an address already contains the network number #17

Open PhaserArray opened 1 year ago

PhaserArray commented 1 year ago

If a stargate in another network doesn't have a 9SymbolCode, the function findAllPossibleDialable will simply use its 6 digit address and append the network and origin of the current stargate.

https://github.com/Zytharian/RbxStargate/blob/5a7cc69f4dd8877eee6675450dc4f412db5b5e62/src/stargate/StargateScript.lua#L1135-L1148

The issue arises when the address of the other stargate already contains the network digit.

For example, say you have a Milkyway network that had the Network value 1 and you want to dial a gate in the Pegasus network with the address of 18 20 1 15 14 7, the resulting address will be 18 20 1 15 14 7 1 X, where X is the point of origin. As each symbol can be dialed once with the DHD, this address is not dialable. This is not an issue with the point of origin as long as activatorInputsOrigin is enabled.

I am not sure what the potential fix would be, perhaps just an address validation function that prints a warning in the output in case of a problematic configuration like this?

Zytharian commented 1 year ago

Mostly a duplicate of #4, but the validation warning is an interesting idea.