Fix being kicked for using the new sponge types

This commit is contained in:
BashGuy10 2022-10-22 20:52:33 -07:00
parent 1c6e69afd3
commit 8818885a9e
2 changed files with 12 additions and 6 deletions

View file

@ -1737,7 +1737,8 @@ namespace TShockAPI
{ {
bucket = 6; bucket = 6;
} }
else if (selectedItemType == ItemID.BottomlessHoneyBucket) else if (selectedItemType == ItemID.BottomlessHoneyBucket
|| selectedItemType == ItemID.HoneyAbsorbantSponge)
{ {
bucket = 7; bucket = 7;
} }
@ -1745,8 +1746,12 @@ namespace TShockAPI
{ {
bucket = 8; bucket = 8;
} }
else if (selectedItemType == ItemID.UltraAbsorbantSponge)
{
bucket = 9;
}
if (!wasThereABombNearby && type == LiquidType.Lava && !(bucket == 2 || bucket == 0 || bucket == 5 || bucket == 6)) if (!wasThereABombNearby && type == LiquidType.Lava && !(bucket == 2 || bucket == 0 || bucket == 5 || bucket == 6 || bucket == 9))
{ {
TShock.Log.ConsoleDebug(GetString("Bouncer / OnLiquidSet rejected bucket check 1 from {0}", args.Player.Name)); TShock.Log.ConsoleDebug(GetString("Bouncer / OnLiquidSet rejected bucket check 1 from {0}", args.Player.Name));
args.Player.SendErrorMessage(GetString("You do not have permission to perform this action.")); args.Player.SendErrorMessage(GetString("You do not have permission to perform this action."));
@ -1766,7 +1771,7 @@ namespace TShockAPI
return; return;
} }
if (!wasThereABombNearby && type == LiquidType.Water && !(bucket == 1 || bucket == 0 || bucket == 4)) if (!wasThereABombNearby && type == LiquidType.Water && !(bucket == 1 || bucket == 0 || bucket == 4 || bucket == 9))
{ {
TShock.Log.ConsoleDebug(GetString("Bouncer / OnLiquidSet rejected bucket check 2 from {0}", args.Player.Name)); TShock.Log.ConsoleDebug(GetString("Bouncer / OnLiquidSet rejected bucket check 2 from {0}", args.Player.Name));
args.Player.SendErrorMessage(GetString("You do not have permission to perform this action.")); args.Player.SendErrorMessage(GetString("You do not have permission to perform this action."));
@ -1786,7 +1791,7 @@ namespace TShockAPI
return; return;
} }
if (!wasThereABombNearby && type == LiquidType.Honey && !(bucket == 3 || bucket == 0 || bucket == 7)) if (!wasThereABombNearby && type == LiquidType.Honey && !(bucket == 3 || bucket == 0 || bucket == 7 || bucket == 9))
{ {
TShock.Log.ConsoleDebug(GetString("Bouncer / OnLiquidSet rejected bucket check 4 from {0}", args.Player.Name)); TShock.Log.ConsoleDebug(GetString("Bouncer / OnLiquidSet rejected bucket check 4 from {0}", args.Player.Name));
args.Player.SendErrorMessage(GetString("You do not have permission to perform this action.")); args.Player.SendErrorMessage(GetString("You do not have permission to perform this action."));
@ -1806,11 +1811,11 @@ namespace TShockAPI
return; return;
} }
if (!wasThereABombNearby && type == LiquidType.Shimmer && bucket != 8) if (!wasThereABombNearby && type == LiquidType.Shimmer && !(bucket == 8 || bucket == 9))
{ {
TShock.Log.ConsoleDebug(GetString("Bouncer / OnLiquidSet rejected bucket check 6 from {0}", args.Player.Name)); TShock.Log.ConsoleDebug(GetString("Bouncer / OnLiquidSet rejected bucket check 6 from {0}", args.Player.Name));
args.Player.SendErrorMessage(GetString("You do not have permission to perform this action.")); args.Player.SendErrorMessage(GetString("You do not have permission to perform this action."));
args.Player.Disable(GetString("Spreading shimmer without holding a honey bucket"), DisableFlags.WriteToLogAndConsole); args.Player.Disable(GetString("Spreading shimmer without holding a shimmer bucket"), DisableFlags.WriteToLogAndConsole);
args.Player.SendTileSquareCentered(tileX, tileY, 1); args.Player.SendTileSquareCentered(tileX, tileY, 1);
args.Handled = true; args.Handled = true;
return; return;

View file

@ -68,6 +68,7 @@ Use past tense when adding new entries; sign your name off when you add or chang
* Introduced support for loadouts, and saving the current loadout index to SSC. Both `NetItem` and `PlayerData` were modified to support this. (@drunderscore) * Introduced support for loadouts, and saving the current loadout index to SSC. Both `NetItem` and `PlayerData` were modified to support this. (@drunderscore)
* Check loadout slots for hacked item stacks. (@drunderscore) * Check loadout slots for hacked item stacks. (@drunderscore)
* Fix players being kicked after using the Flamethrower to apply the `OnFire3` debuff for `1200` ticks. (@BashGuy10) * Fix players being kicked after using the Flamethrower to apply the `OnFire3` debuff for `1200` ticks. (@BashGuy10)
* Fix being kicked for using the new sponge types on liquid. (@BashGuy10)
## TShock 4.5.18 ## TShock 4.5.18
* Fixed `TSPlayer.GiveItem` not working if the player is in lava. (@PotatoCider) * Fixed `TSPlayer.GiveItem` not working if the player is in lava. (@PotatoCider)