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`.
This commit is contained in:
James Puleo 2022-11-07 10:35:22 -05:00 committed by Lucas Nicodemus
parent 5a72121200
commit ad9c9cccce
No known key found for this signature in database

View file

@ -673,7 +673,7 @@ namespace TShockAPI
NetMessage.SendData(42, player.Index, -1, NetworkText.Empty, player.Index, 0f, 0f, 0f, 0); 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); 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; player.TPlayer.buffType[k] = 0;
} }