Use same TSPlayer.Active check

This commit is contained in:
SGKoishi 2022-12-12 17:15:34 -08:00
parent c6b60e22d7
commit 59f9440d17
No known key found for this signature in database
GPG key ID: 8FFC399070653828
4 changed files with 12 additions and 12 deletions

View file

@ -1878,7 +1878,7 @@ namespace TShockAPI
return;
}
if (TShock.Players[id] == null)
if (TShock.Players[id] == null || !TShock.Players[id].Active)
{
TShock.Log.ConsoleDebug(GetString(
"Bouncer / OnPlayerBuff rejected {0} ({1}) applying buff {2} to {3} for {4} ticks: target is null", args.Player.Name,
@ -2081,7 +2081,7 @@ namespace TShockAPI
short amount = args.Amount;
byte plr = args.TargetPlayerIndex;
if (amount <= 0 || Main.player[plr] == null || !Main.player[plr].active)
if (amount <= 0 || TShock.Players[plr] == null || !TShock.Players[plr].Active)
{
TShock.Log.ConsoleDebug(GetString("Bouncer / OnHealOtherPlayer rejected null checks"));
args.Handled = true;
@ -2589,7 +2589,7 @@ namespace TShockAPI
byte direction = args.Direction;
PlayerDeathReason reason = args.PlayerDeathReason;
if (id >= Main.maxPlayers || TShock.Players[id] == null)
if (id >= Main.maxPlayers || TShock.Players[id] == null || !TShock.Players[id].Active)
{
TShock.Log.ConsoleDebug(GetString("Bouncer / OnPlayerDamage rejected null check"));
args.Handled = true;