Fix startup vehicle cleanup treating all players as offline#148
Open
alexban01 wants to merge 2 commits into
Open
Fix startup vehicle cleanup treating all players as offline#148alexban01 wants to merge 2 commits into
alexban01 wants to merge 2 commits into
Conversation
RespawnPlayerVehicles was calling EPF_PersistentWorldEntityLoader.Load (synchronous), which always returns null. Replace with LoadAsync and an OnVehicleLoaded callback matching the recruit manager pattern. InitialVehicleCleanup is preserved - vehicles are still despawned on startup when the owner is offline and respawned on player connect. Also add null guard in FinalizePlayerPreparation for first-time players who have no OVT_PlayerData yet.
0b89649 to
1509506
Compare
The online check used OVT_PlayerManagerComponent.GetPlayer() which always returned null at startup - m_mPlayers is reset in Init() and SetupPlayer is blocked by a chicken-and-egg dependency on GetPersistentIDFromPlayerID. Replace with IsPlayerOnline() which directly queries EPF_Utils.GetPlayerUID across all connected players, matching the authoritative EPF identity source.
1509506 to
515ec6f
Compare
Author
|
I'm guessing this issue isn't happening on dedicated servers (unless the player somehow manages to connect to the server in the 5 second time window from server started -> cleanup) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug where InitialVehicleCleanup was deleting the player's starting car 5 seconds after game start. The online player check was using OVT_PlayerManagerComponent.GetPlayer() which always returned null at that point due to a startup ordering issue, causing every locked vehicle to be treated as owned by an offline player. Fixed by checking connected players directly via EPF_Utils.GetPlayerUID() instead.
Should resolve #146 and part of #143