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.
This commit is contained in:
Lucas Nicodemus 2021-11-20 20:02:23 -08:00
parent f523d38300
commit 1aa9956e45
2 changed files with 2 additions and 1 deletions

View file

@ -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)

View file

@ -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"));
}
}