Only allow using Teleportation Potion and friends whilst holding them
This commit is contained in:
parent
1e5e3cd864
commit
b07497ca2b
2 changed files with 22 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
|
||||||
* If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change.
|
* If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change.
|
||||||
|
|
||||||
## Upcoming changes
|
## Upcoming changes
|
||||||
|
* Only allow using Teleportation Potions, Magic Conch, and Demon Conch whilst holding them. (@drunderscore)
|
||||||
|
|
||||||
## TShock 4.5.17
|
## TShock 4.5.17
|
||||||
* Fixed duplicate characters (twins) after repeatedly logging in as the same character due to connection not being immediately closed during `NetHooks_NameCollision`. (@gohjoseph)
|
* Fixed duplicate characters (twins) after repeatedly logging in as the same character due to connection not being immediately closed during `NetHooks_NameCollision`. (@gohjoseph)
|
||||||
|
|
|
||||||
|
|
@ -3814,6 +3814,13 @@ namespace TShockAPI
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case 0: // Teleportation Potion
|
case 0: // Teleportation Potion
|
||||||
|
if (args.Player.ItemInHand.type != ItemID.TeleportationPotion &&
|
||||||
|
args.Player.SelectedItem.type != ItemID.TeleportationPotion)
|
||||||
|
{
|
||||||
|
TShock.Log.ConsoleDebug("GetDataHandlers / HandleTeleportationPotion rejected not holding the correct item {0} {1}", args.Player.Name, type);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!args.Player.HasPermission(Permissions.tppotion))
|
if (!args.Player.HasPermission(Permissions.tppotion))
|
||||||
{
|
{
|
||||||
Fail("Teleportation Potions");
|
Fail("Teleportation Potions");
|
||||||
|
|
@ -3821,6 +3828,13 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1: // Magic Conch
|
case 1: // Magic Conch
|
||||||
|
if (args.Player.ItemInHand.type != ItemID.MagicConch &&
|
||||||
|
args.Player.SelectedItem.type != ItemID.MagicConch)
|
||||||
|
{
|
||||||
|
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.HasPermission(Permissions.magicconch))
|
||||||
{
|
{
|
||||||
Fail("the Magic Conch");
|
Fail("the Magic Conch");
|
||||||
|
|
@ -3828,6 +3842,13 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2: // Demon Conch
|
case 2: // Demon Conch
|
||||||
|
if (args.Player.ItemInHand.type != ItemID.DemonConch &&
|
||||||
|
args.Player.SelectedItem.type != ItemID.DemonConch)
|
||||||
|
{
|
||||||
|
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.HasPermission(Permissions.demonconch))
|
||||||
{
|
{
|
||||||
Fail("the Demon Conch");
|
Fail("the Demon Conch");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue