SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
84 stars 18 forks source link

OnTellVirus inconsistent #4373

Closed rube200 closed 1 month ago

rube200 commented 3 months ago

Atm there is to events for virus change: onVirusUpdated and OnTellVirus_Global But the problem is onVirusUpdated is almost always client-side except for AskRadiate but that method doesn't emit OnTellVirus_Global.

So current game implementation: askDisinfect and askInfect -> OnTellVirus_Global, OnVirusUpdated (but this last one in client side only) AskRadiate -> OnVirusUpdated

SDGNelson commented 3 months ago

Thanks for pointing this out. I'll take a look at what's going on.

SDGNelson commented 3 months ago

onVirusUpdated is the original old client-side event for notifying the UI to change. askRadiate is called on both client and server while standing in a deadzone - and is only used for that one case - which is questionable but that's why it doesn't call the RPC.

For the next update I've changed askRadiate to also call OnTellVirus_Global 👍