space-wizards / space-station-14

A multiplayer game about paranoia and chaos on a space station. Remake of the cult-classic Space Station 13.
https://spacestation14.io
MIT License
2.56k stars 3.18k forks source link

Breaking zipties spawns dozen of broken ziptie entities #15730

Closed Slava0135 closed 1 year ago

Slava0135 commented 1 year ago

Description

Reproduction

Screenshots

(Actually I broke 2 zipties in cell, but there are 10 stacked entities for some reason) Screenshot_2023-04-23_14-47-47

Additional context

deltanedas commented 1 year ago

99% sure its client entities spawned by prediction check _timing.IsFirstTimePredicted or something in cuff system uncuff code

Menshin commented 1 year ago

Agreed with deltanedas, it's probably the same prediction problem as item dropping or toolbar icon duplication. With the (un)equippedhand events now properly sent, more like these are bound to appear while the misprediction is not fixed. More like a doafter related problem after all...

ElectroJr commented 1 year ago

Its not directly related to do afters, its just a problem with cuffable system spawning entities in shared code. If entities get spawned in Content.Shared you need to make sure the client doesn't spawn any, usually either by wrapping it in INetManager.IsServer, or by making the function that does the spawning abstract & having a separate server & client system.

Checking IsFirstTimePredicted would just make the client spawn only one client-side entity, but wouldn't actually stop it from being spawned altogether.

Menshin commented 1 year ago

Understood, i'm fixing that.

Thanks.