From 1aa9956e45c5d687644581de510f7a510cb24e86 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 20 Nov 2021 20:02:23 -0800 Subject: [PATCH] Report correct god mode status to target player The previous version of the code always told the player having their god mode toggled the state of the player that issued the command, rather than their own god mode state. This fixes that issue, and now returns the correct player's state to the correct player. --- CHANGELOG.md | 1 + TShockAPI/Commands.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95984319..af4a51b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Added Deerclops to `/spawnboss` command. (@hakusaro, @HiddenStriker) * Fixed [GHSA-6w5v-hxr3-m2wx](https://github.com/Pryaxis/TShock/security/advisories/GHSA-6w5v-hxr3-m2wx). (@Yoraiz0r, @Arthri) * Fixed an issue where player build permissions would reject gem lock changes, even if `RegionProtectGemLocks` was disabled in the config file. Now, players will be permitted to use gem locks if they don't have build permission in a region, but `RegionProtectGemLocks` is disabled. If `RegionProtectGemLocks` is enabled, players will be unable to use gem locks in a build region. (@hakusaro, @Kojirremer, @Arthri) +* Fixed an issue where `/god [player]` would tell `[player]` that they were in godmode regardless of whether or not they were or not. (@hakusaro, @Kojirremer) ## TShock 4.5.5 * Changed the world autosave message so that it no longer warns of a "potential lag spike." (@hakusaro) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 0406e858..8d620e73 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -6697,7 +6697,7 @@ namespace TShockAPI if (!args.Silent || (playerToGod == args.Player)) { - playerToGod.SendSuccessMessage(string.Format("You are {0} in god mode.", args.Player.GodMode ? "now" : "no longer")); + playerToGod.SendSuccessMessage(string.Format("You are {0} in god mode.", playerToGod.GodMode ? "now" : "no longer")); } }