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

onTransformRequested not emitted on mouse right click. #4377

Closed StilauGamer closed 1 month ago

StilauGamer commented 3 months ago

OnTransformRequested from BarricadeManager is not always emitted when moving barricades.

From my understanding its moving the barricade, and then networking to the server telling if its allowed to or not to place the barricade there while emitting the OnTransformRequested event.

But when clicking the mouse right click while moving, you can see the mouse cursor snaps to the middle, and it places the barricade there on the client, but its not being networked to the server telling it got moved.

Server Code: BarricadeManager.ReceiveTransformRequest Client Code: BarricadeManager.transformBarricade ( I think ) Keybind pressed: Secondary ( Standard = Right Click )

Easiest way to replicate, set the shouldAllow to false, and you can easily replicate it. If not it will look like its working as you first move it where it should not work, and then move again. It won't teleport back as it thinks thats the new location.

StilauGamer commented 3 months ago

Video, you can also see that the server sided collision is in the video.

https://github.com/SmartlyDressedGames/Unturned-3.x-Community/assets/72885244/56baa10d-9edb-4f52-b0b8-726ae9bf80db

SDGNelson commented 3 months ago

Thanks for the report! The issue was that exiting building mode and/or pressing right-click while moving buildables both cancel the action without submitting changes to the server - this should now be fixed for the next update.