[Cleanup] quest::createBot() unnecessary check against nullptr (#3302)

# Notes
- We initialize this variable, so it can never be a nullptr.
This commit is contained in:
Alex King 2023-04-23 15:08:50 -04:00 committed by GitHub
parent 576f99f292
commit 8b1d64a043
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2595,7 +2595,6 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level
Bot* new_bot = new Bot(Bot::CreateDefaultNPCTypeStructForBot(name, lastname, level, race, botclass, gender), initiator); Bot* new_bot = new Bot(Bot::CreateDefaultNPCTypeStructForBot(name, lastname, level, race, botclass, gender), initiator);
if (new_bot) {
if (!new_bot->IsValidRaceClassCombo()) { if (!new_bot->IsValidRaceClassCombo()) {
initiator->Message(Chat::White, "That Race/Class combination cannot be created."); initiator->Message(Chat::White, "That Race/Class combination cannot be created.");
return false; return false;
@ -2632,7 +2631,7 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level
); );
if (parse->PlayerHasQuestSub(EVENT_BOT_CREATE)) { if (parse->PlayerHasQuestSub(EVENT_BOT_CREATE)) {
const auto& export_string = fmt::format( const auto &export_string = fmt::format(
"{} {} {} {} {}", "{} {} {} {} {}",
name, name,
new_bot->GetBotID(), new_bot->GetBotID(),
@ -2647,7 +2646,6 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level
return true; return true;
} }
} }
}
return false; return false;
} }