Fixed NetworkCollider bug to allow for comparisons between current tick and last tick stored sets#1041
Open
strakerak wants to merge 2 commits into
Open
Fixed NetworkCollider bug to allow for comparisons between current tick and last tick stored sets#1041strakerak wants to merge 2 commits into
strakerak wants to merge 2 commits into
Conversation
Changed localTick to lastTick for removal after collider comparisons are run. If removing localTick, lastTick cannot be found or accessed, hence removing any ability to run comparisons.
|
@strakerak nice catch, explains why I was also running into this bug! Note: I believe your fix is incomplete; you also need to change the Something like this: becomes |
Author
|
Thanks for that pick up! I mainly centered my update around NetworkCollider, not NetworkCollider2D. I'll make that update on my end as well 🙂
Regards,
-Sammy
…________________________________
From: aaronkwan ***@***.***>
Sent: Monday, May 25, 2026 9:48 PM
To: FirstGearGames/FishNet ***@***.***>
Cc: strakerak ***@***.***>; Mention ***@***.***>
Subject: Re: [FirstGearGames/FishNet] Fixed NetworkCollider bug to allow for comparisons between current tick and last tick stored sets (PR #1041)
[https://avatars.githubusercontent.com/u/123356351?s=20&v=4]aaronkwan left a comment (FirstGearGames/FishNet#1041)<#1041 (comment)>
@strakerak<https://github.com/strakerak> nice catch, explains why I was also running into this bug!
Note: I believe your fix is incomplete; you also need to change the localTick to lastTick in the TryGetValueIL2CPP call.
Something like this:
if (lastTick is not unsetLastTick && _enteredColliders.TryGetValueIL2CPP(localTick, out HashSet<Collider2D> lEnteredColliders))
becomes
if (lastTick is not unsetLastTick && _enteredColliders.TryGetValueIL2CPP(lastTick, out HashSet<Collider2D> lEnteredColliders))
—
Reply to this email directly, view it on GitHub<#1041?email_source=notifications&email_token=AANZPBWU42CORGFO7SHYAQ344UAYDA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINJTHE2DKMZWGAY2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4539453601>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AANZPBXTWZFCW5NG2CX2SLL44UAYDAVCNFSM6AAAAACZAAVOL6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DKMZZGQ2TGNRQGE>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the 4.7.2 update, the IL2CPP code was added while checking if lastTick was not unsetLastTick (max value). If this condition passed, localTick would be removed from the _enteredColliders HashSet. However, this is ran after adding everything to localtick, so it would render that entire entry useless.
Whenever it would check for LastEnteredColliders in either method, it would resolve to Null as there is no entry in the HashSet from the lastTick, ONLY the current localTick can be accessed within that code snippet.
So anytime that code snippet is ran, it would always resolve to OnEnters, but no OnStays or OnExits.
Changing it from localTick back to lastTick (as it was changed to localTick in the recent update) fixed this, and now both OnStays and OnExits are called.
Found when entering a platform on my game, and it kept me as a parent even though I ran far away from it, nothing in OnExit would be called, and I thought it wasn't subscribing at first. Turns out it was just an access issue for comparisons.
Long description because reading through the entire code allows me to understand more about how it works on the Networking Side, it's a lot of fun!