From ad9c9cccceefad7bbd0c8ef1134788f525060e79 Mon Sep 17 00:00:00 2001 From: James Puleo Date: Mon, 7 Nov 2022 10:35:22 -0500 Subject: [PATCH] Properly remove all buffs in `PlayerData.RestoreCharacter` This was previously using the constant `22` directly, instead of `Player.maxBuffs`, which is now `44`. This theoretically allowed players to smuggle buffs on to servers with SSC enabled, by using buff indexes past `22`. --- TShockAPI/PlayerData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/PlayerData.cs b/TShockAPI/PlayerData.cs index d0eff368..2a8dd41f 100644 --- a/TShockAPI/PlayerData.cs +++ b/TShockAPI/PlayerData.cs @@ -673,7 +673,7 @@ namespace TShockAPI NetMessage.SendData(42, player.Index, -1, NetworkText.Empty, player.Index, 0f, 0f, 0f, 0); NetMessage.SendData(16, player.Index, -1, NetworkText.Empty, player.Index, 0f, 0f, 0f, 0); - for (int k = 0; k < 22; k++) + for (int k = 0; k < Player.maxBuffs; k++) { player.TPlayer.buffType[k] = 0; }