From b5b0e53da2afca389c669b0d9367e60196d8b7da Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Sat, 7 Oct 2023 13:59:56 -0500 Subject: [PATCH] [Crash] Fix #summon crash (#3608) * [Crash] Summon crash fix * [Crash] Fix summon crash --- zone/gm_commands/summon.cpp | 9 +++++++-- zone/mob.cpp | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/zone/gm_commands/summon.cpp b/zone/gm_commands/summon.cpp index 6a4c568d8..d6bdea88b 100755 --- a/zone/gm_commands/summon.cpp +++ b/zone/gm_commands/summon.cpp @@ -58,12 +58,17 @@ void command_summon(Client *c, const Seperator *sep) } else if (c->GetTarget()) { target = c->GetTarget(); } - + if (c == target) { c->Message(Chat::White, "You cannot summon yourself."); return; } - + + if (!target) { + c->Message(Chat::White, "You must have a target to summon."); + return; + } + c->Message( Chat::White, fmt::format( diff --git a/zone/mob.cpp b/zone/mob.cpp index 09cdee6b9..1a4a20ba4 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -5114,7 +5114,7 @@ std::string Mob::GetTargetDescription(Mob* target, uint8 description_type, uint1 auto d = fmt::format( "{}", ( - this == target ? + target && this == target ? self_return : fmt::format( "{} ({})",