R2Northstar / NorthstarMods

Squirrel scripts used to recreate server-side gamelogic and add custom content to the game.
MIT License
153 stars 122 forks source link

UI Error after being kicked by NSDisconnectPlayer during loading screen #849

Open Bobbyperson opened 2 weeks ago

Bobbyperson commented 2 weeks ago

image

[SCRIPT UI] [info] SCRIPT ERROR: [UI] Entity is null
[SCRIPT UI] [info]  -> int loadoutIndex = player.GetPersistentVarAsInt( loadoutType + "SpawnLoadout.index" )
[SCRIPT UI] [info] 
CALLSTACK
*FUNCTION [GetPersistentSpawnLoadoutIndex()] sh_loadouts.nut line [2815]
*FUNCTION [UpdateCachedLoadouts_Threaded()] sh_progression.nut line [172]

[SCRIPT UI] [info] LOCALS
[loadoutType] "pilot"
[player] NULL
[this] NULL
[this] NULL

DIAGPRINTS

Steps to reproduce:

  1. Get kicked by NSDisconnectPlayer while loading into a game
  2. Observe results

This was observed on prior Northstar versions (at least a few major versions back) and has been reproduced by me on latest.

EM4Volts commented 2 weeks ago

This happens if you connect to a server / map before loading has finished for the main menu or the end of gsme challenge stuff has properly finished. If anyone wants to reproduce

Jan200101 commented 1 week ago

Ran into this by coincidence looks to be a race condition in UpdateCachedLoadouts_Threaded, it is trying to get the loadout after the player entity has already been nulled.

solution would be to check if the player entity is valid either in GetPersistentSpawnLoadoutIndex or UpdateCachedLoadouts_Threaded

GeckoEidechse commented 1 week ago

cc @Zanieon