From 9fbab76d40a85008b2360c70f7582ed6b21beea3 Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Fri, 6 May 2022 20:06:04 -0400 Subject: [PATCH] [Commands] Cleanup #summonburiedplayercorpse Command. (#2146) * [Commands] Cleanup #summonburiedplayercorpse Command. - Cleanup messages and logic. * Update summonburiedplayercorpse.cpp --- zone/gm_commands/summonburiedplayercorpse.cpp | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/zone/gm_commands/summonburiedplayercorpse.cpp b/zone/gm_commands/summonburiedplayercorpse.cpp index 5534ecadc..f82717740 100755 --- a/zone/gm_commands/summonburiedplayercorpse.cpp +++ b/zone/gm_commands/summonburiedplayercorpse.cpp @@ -3,26 +3,34 @@ void command_summonburiedplayercorpse(Client *c, const Seperator *sep) { - Client *t = c; - + auto target = c; if (c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) { - t = c->GetTarget()->CastToClient(); - } - else { - c->Message(Chat::White, "You must first select a target!"); - return; + target = c->GetTarget()->CastToClient(); } - Corpse *PlayerCorpse = database.SummonBuriedCharacterCorpses( - t->CharacterID(), - t->GetZoneID(), + auto *corpse = database.SummonBuriedCharacterCorpses( + target->CharacterID(), + target->GetZoneID(), zone->GetInstanceID(), - t->GetPosition()); + target->GetPosition() + ); - if (!PlayerCorpse) { - c->Message(Chat::White, "Your target doesn't have any buried corpses."); + if (!corpse) { + c->Message( + Chat::White, + fmt::format( + "{} not have any buried corpses.", + ( + c == target ? + "You do" : + fmt::format( + "{} ({}) does", + target->GetCleanName(), + target->GetID() + ) + ) + ).c_str() + ); } - - return; }