Skip to content

Commit

Permalink
Remove /ungodme
Browse files Browse the repository at this point in the history
With 1.4.2.2, we no longer need to offer an escape hatch due to the
underlying bug involving godmode being permanently applied to local
players now having been fixed.
  • Loading branch information
hakusaro committed Apr 22, 2021
1 parent 4668ab8 commit 6bb4230
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin

## TShock 4.5.2
* Added preliminary support for Terraria 1.4.2.2. (@hakusaro)
* Removed `/ungodmode` and godmode warning (no longer necessary). Also, godmode now supports silent commands. (@hakusaro)

## TShock 4.5.1
* Fixed server crash from `/v2/players/list` & other parameterised REST endpoints. (@QuiCM, reported by @ATFGK)
Expand Down
20 changes: 4 additions & 16 deletions TShockAPI/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -545,11 +545,6 @@ public static void InitCommands()
{
HelpText = "Toggles godmode on a player."
});
add(new Command("", ForceUngod, "ungodme")
{
HelpText = "Removes godmode from your character.",
AllowServer = false
});
add(new Command(Permissions.heal, Heal, "heal")
{
HelpText = "Heals a player in HP and MP."
Expand Down Expand Up @@ -6461,17 +6456,10 @@ private static void ToggleGodMode(CommandArgs args)
args.Player.SendSuccessMessage(string.Format("{0} is {1} in god mode.", playerToGod.Name, playerToGod.GodMode ? "now" : "no longer"));
}

playerToGod.SendSuccessMessage(string.Format("You are {0} in god mode.", args.Player.GodMode ? "now" : "no longer"));
playerToGod.SendInfoMessage("Please make sure to disable godmode using /ungodme before disconnecting, otherwise your character may remain in godmode indefinitely, including singleplayer.");
}

private static void ForceUngod(CommandArgs args)
{
var godPower = CreativePowerManager.Instance.GetPower<CreativePowers.GodmodePower>();

godPower.SetEnabledState(args.Player.Index, false);

args.Player.SendSuccessMessage("Journey Godmode has been disabled on your character.");
if (!args.Silent || (playerToGod == args.Player))
{
playerToGod.SendSuccessMessage(string.Format("You are {0} in god mode.", args.Player.GodMode ? "now" : "no longer"));
}
}

#endregion Cheat Comamnds
Expand Down

0 comments on commit 6bb4230

Please sign in to comment.