Merge pull request #2952 from drunderscore/fix/player-data-is-sometimes-not-there
Ensure `TSPlayer.PlayerData` is non-null whilst syncing loadouts
This commit is contained in:
commit
64a4c9c1cd
2 changed files with 7 additions and 0 deletions
|
|
@ -4445,6 +4445,11 @@ namespace TShockAPI
|
|||
return true;
|
||||
}
|
||||
|
||||
// Don't modify the player data if it isn't there.
|
||||
// This is the case whilst the player is connecting, as we receive the SyncLoadout packet before the ContinueConnecting2 packet.
|
||||
if (args.Player.PlayerData == null)
|
||||
return false;
|
||||
|
||||
// The client does not sync slot changes when changing loadouts, it only tells the server the loadout index changed,
|
||||
// and the server will replicate the changes the client did. This means that PlayerData.StoreSlot is never called, so we need to
|
||||
// swap around the PlayerData items ourself.
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ Use past tense when adding new entries; sign your name off when you add or chang
|
|||
* Fixed the `/wind` command not being very helpful. (@punchready)
|
||||
* Fixed /help, /me, and /p commands can't work in non-English languages. (@ACaiCat)
|
||||
* Added a hook `AccountHooks.AccountGroupUpdate`, which is called when you change the user group. (@AgaSpace)
|
||||
* * Ensured `TSPlayer.PlayerData` is non-null whilst syncing loadouts. (@drunderscore)
|
||||
|
||||
## TShock 5.2.1
|
||||
* Updated `TSPlayer.GodMode`. (@AgaSpace)
|
||||
|
|
@ -108,6 +109,7 @@ Use past tense when adding new entries; sign your name off when you add or chang
|
|||
* Added CI for Docker images. (@timschumi)
|
||||
* Fixed Cursed Flares kicking players for invalid buff. (@Arthri)
|
||||
|
||||
|
||||
## TShock 5.2
|
||||
* An additional option `pvpwithnoteam` is added at `PvPMode` to enable PVP with no team. (@CelestialAnarchy, #2617, @ATFGK)
|
||||
* Corrected and updated deserialization of the following packets (@ATFGK):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue