Zetrith/Multiplayer

IntersectRay always returns true on arbiter

Closed this issue · 2 comments

The function UnityEngine.Bounds.IntersectRay returns true on the arbiter regardless of the values passed. This results in a desync being reported in mods that use this function.

I have not tested if any other unity raycast functions are affected.

I have not investigated why this is the case. Even if I could figure out the cause I can not fix the arbiter at this time due to pull requests not being accepted on this repo.

As a workaround I will write my own function to replace the broken one. I will paste the code here in case other have the same issue.

The more I think about it, the more I feel like this is a unity bug. Clearly something in the way the graphics are skipped for the arbiter is triggering it, but this function should not be relying on unity objects or graphical stuff because it is a purely mathematical calculation.

Hmm, after further investigation I was wrong about this, there are tiny differences in the z levels so the function is simply returning different results because the input values are different