Fix player does't use the Shellphone (Ocean), Shellphone (Underworld) and Shellphone (Spawn).

This commit is contained in:
hufang360 2022-10-08 22:50:28 +08:00
parent 0c37b0fed3
commit 66379a4a17
2 changed files with 32 additions and 6 deletions

View file

@ -32,6 +32,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
* Fixed painting wall/tile being rejected from hand of creation. (@Rozen4334)
* Added a second `Utils.TryParseTime` method for parsing large, positive time spans. (@punchready)
* Fixed `/tempgroup` breaking on durations greater than roughly 24 days. (@punchready)
* Fix player does't use the Shellphone (Ocean), Shellphone (Underworld) and Shellphone (Spawn). (@hufang360)
## TShock 4.5.18
* Fixed `TSPlayer.GiveItem` not working if the player is in lava. (@gohjoseph)

View file

@ -3828,31 +3828,56 @@ namespace TShockAPI
return true;
}
break;
case 1: // Magic Conch
case 1: // Magic Conch or Shellphone (Ocean)
if (args.Player.ItemInHand.type != ItemID.MagicConch &&
args.Player.SelectedItem.type != ItemID.MagicConch)
args.Player.SelectedItem.type != ItemID.MagicConch &&
args.Player.ItemInHand.type != ItemID.ShellphoneOcean &&
args.Player.SelectedItem.type != ItemID.ShellphoneOcean)
{
TShock.Log.ConsoleDebug("GetDataHandlers / HandleTeleportationPotion rejected not holding the correct item {0} {1}", args.Player.Name, type);
return true;
}
if (!args.Player.HasPermission(Permissions.magicconch))
{
if (args.Player.ItemInHand.type == ItemID.ShellphoneOcean || args.Player.SelectedItem.type != ItemID.ShellphoneOcean)
{
Fail("the Shellphone (Ocean)");
}
else
{
Fail("the Magic Conch");
}
return true;
}
break;
case 2: // Demon Conch
case 2: // Demon Conch or Shellphone (Underworld)
if (args.Player.ItemInHand.type != ItemID.DemonConch &&
args.Player.SelectedItem.type != ItemID.DemonConch)
args.Player.SelectedItem.type != ItemID.DemonConch &&
args.Player.ItemInHand.type != ItemID.ShellphoneHell &&
args.Player.SelectedItem.type != ItemID.ShellphoneHell)
{
TShock.Log.ConsoleDebug("GetDataHandlers / HandleTeleportationPotion rejected not holding the correct item {0} {1}", args.Player.Name, type);
return true;
}
if (!args.Player.HasPermission(Permissions.demonconch))
{
if (args.Player.ItemInHand.type == ItemID.ShellphoneHell || args.Player.SelectedItem.type != ItemID.ShellphoneHell)
{
Fail("the Shellphone (Underworld)");
}
else
{
Fail("the Demon Conch");
}
return true;
}
break;
case 3: // Shellphone (Spawn)
if (args.Player.ItemInHand.type != ItemID.ShellphoneSpawn && args.Player.SelectedItem.type != ItemID.ShellphoneSpawn)
{
TShock.Log.ConsoleDebug("GetDataHandlers / HandleTeleportationPotion rejected not holding the correct item {0} {1}", args.Player.Name, type);
return true;
}
break;