mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
[Cleanup] Remove possible dereferenced nullptrs in bot.cpp (#3241)
# Notes - Possible dereferenced nullptrs based on logic.
This commit is contained in:
parent
cb129efcad
commit
c9f27d6f90
11
zone/bot.cpp
11
zone/bot.cpp
@ -4533,8 +4533,10 @@ bool Bot::Death(Mob *killerMob, int64 damage, uint16 spell_id, EQ::skills::Skill
|
||||
give_exp_client = give_exp->CastToClient();
|
||||
|
||||
bool IsLdonTreasure = (GetClass() == LDON_TREASURE);
|
||||
if (entity_list.GetCorpseByID(GetID()))
|
||||
entity_list.GetCorpseByID(GetID())->Depop();
|
||||
const auto c = entity_list.GetCorpseByID(GetID());
|
||||
if (c) {
|
||||
c->Depop();
|
||||
}
|
||||
|
||||
if (HasRaid()) {
|
||||
if (auto raid = entity_list.GetRaidByBotName(GetName()); raid) {
|
||||
@ -6831,8 +6833,11 @@ Bot* Bot::GetBotByBotClientOwnerAndBotName(Client* c, const std::string& botName
|
||||
void Bot::ProcessBotGroupInvite(Client* c, std::string const& botName) {
|
||||
if (c && !c->HasRaid()) {
|
||||
Bot* invitedBot = GetBotByBotClientOwnerAndBotName(c, botName);
|
||||
if (!invitedBot) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (invitedBot && !invitedBot->HasGroup() && !invitedBot->HasRaid()) {
|
||||
if (!invitedBot->HasGroup() && !invitedBot->HasRaid()) {
|
||||
if (!c->IsGrouped()) {
|
||||
auto g = new Group(c);
|
||||
if (AddBotToGroup(invitedBot, g)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user