Facepunch / sbox-issues

175 stars 12 forks source link

When Host leaves it it removes the object to early #6295

Open EuroBlue opened 2 months ago

EuroBlue commented 2 months ago

Describe the bug

When host leaves it's object gets removed to early. Needed functions can't work properly when the object is already misssing. It could be something to do how the Host changes my assumption is when the host changes it deletes the previous object before Networks OnDissconect is called. It makes it impossible to implement save on leave mechanism on the host

To Reproduce

  1. Join any game. to example Marble Race
  2. Wait for the host to leave
  3. You see in the Chat "Unknown Player left" which is a sigh that the player object was deleted to eary

Expected behavior

When Host leaves it should under go the standard procedure without the object being removed on its own.

Media/Files

Here are some files from the project that I'm working on and marble racer. Logs and code from own gamemode: 2024/08/21 01:16:12.8162 [GameMenu] Removing player: 5f82bb60-8fef-4fbc-af12-7eae8734b230 hepe_fuil 2024/08/21 01:16:12.8162 [GameMenu] Player not found in the list: 5f82bb60-8fef-4fbc-af12-7eae8734b230 image Marble Racer: image

Additional context

No response

EuroBlue commented 2 months ago

HellO?