Predictive spawning key issue, documentation example produces a bug

lord
lord
edited November 2022 in Fusion

Referring to this page: https://doc.photonengine.com/en-us/fusion/current/manual/spawning and this piece of code:

var predictionKey = new NetworkObjectPredictionKey {Byte0 = (byte) Runner.Simulation.Tick, Byte1 = playerIndex};

This assumes that prediction key 0 is acceptable as it could happen on every 256th tick and if the player index is 0. While Fusion happily accepts prediction key 0, NetworkObject.IsPredictedSpawn basically only checks if this key is not 0, meaning if you are unlucky, your predicted object won't tell you it's predicted, producing hard to detect bugs.

I couldn't find a place where it is mentioned that prediction key 0 is not a valid key, this should at least be mentioned in the documentation, or the Runner.Spawn should reject key 0 with an error, or some other solution should be implement.