mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-17 18:41:29 +00:00
[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:
parent
576f99f292
commit
8b1d64a043
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user