Skip to content

Early OnPlayerLoaded causes Save() before spawn is finalized (character select / relog) #730

@solayff

Description

@solayff

Summary

OnPlayerLoaded is triggered too early during character selection, causing metadata-driven Save() to store hidden multichar coordinates instead of the player’s actual position.

Reproduction

  1. Join the server and select a character.
  2. Move to a different location or world.
  3. Logout.
  4. Rejoin and select the same character.
  5. Player respawns at multichar hidden coordinates instead of the last saved location.

Expected behavior

Player position should only be saved after the final spawn location is applied, not during character selection or hidden multichar transitions.

Actual behavior

During character selection, OnPlayerLoaded triggers metadata updates (e.g. isdead/inlaststand) which call Save() before the spawn is finalized, overwriting the last valid position with multichar hidden coordinates.

Additional context

This is caused by qbx_medical scripts updating death-related metadata (isdead / inlaststand) immediately after OnPlayerLoaded.
Those metadata updates call Save() while the player is still at multichar hidden coords.

A simple delay (e.g. ~3 seconds) before triggering OnPlayerLoaded on the client side resolves the issue and ensures Save() runs after the final spawn.

Current Version

main branch (latest)

Custom Resources

qbx_medical, qbx_core

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneed reproThis bug report needs confirmation

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions