[Crash] Fix #summon crash (#3608)

* [Crash] Summon crash fix

* [Crash] Fix summon crash
This commit is contained in:
Chris Miles 2023-10-07 13:59:56 -05:00 committed by GitHub
parent 68cb94b39c
commit b5b0e53da2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -58,12 +58,17 @@ void command_summon(Client *c, const Seperator *sep)
} else if (c->GetTarget()) { } else if (c->GetTarget()) {
target = c->GetTarget(); target = c->GetTarget();
} }
if (c == target) { if (c == target) {
c->Message(Chat::White, "You cannot summon yourself."); c->Message(Chat::White, "You cannot summon yourself.");
return; return;
} }
if (!target) {
c->Message(Chat::White, "You must have a target to summon.");
return;
}
c->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(

View File

@ -5114,7 +5114,7 @@ std::string Mob::GetTargetDescription(Mob* target, uint8 description_type, uint1
auto d = fmt::format( auto d = fmt::format(
"{}", "{}",
( (
this == target ? target && this == target ?
self_return : self_return :
fmt::format( fmt::format(
"{} ({})", "{} ({})",