[Commands] Cleanup #gm Command. (#1830)

- Cleanup message and logic.
- Cleanup SetGM() message.
This commit is contained in:
Kinglykrab
2021-11-26 10:01:13 -05:00
committed by GitHub
parent 514029a6bb
commit 2dc3ca52db
3 changed files with 27 additions and 19 deletions
+7 -1
View File
@@ -2076,7 +2076,13 @@ bool Client::ChangeFirstName(const char* in_firstname, const char* gmname)
void Client::SetGM(bool toggle) {
m_pp.gm = toggle ? 1 : 0;
m_inv.SetGMInventory((bool)m_pp.gm);
Message(Chat::Red, "You are %s a GM.", m_pp.gm ? "now" : "no longer");
Message(
Chat::White,
fmt::format(
"You are {} flagged as a GM.",
m_pp.gm ? "now" : "no longer"
).c_str()
);
SendAppearancePacket(AT_GM, m_pp.gm);
Save();
UpdateWho();