mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
[Bug Fix] Fix scenario where dereferenced object could be null. (#2784)
This commit is contained in:
parent
93eddf603b
commit
4d355afe9d
@ -2770,7 +2770,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (killer_mob->IsBot()) {
|
if (killer_mob && killer_mob->IsBot()) {
|
||||||
parse->EventBot(EVENT_NPC_SLAY, killer_mob->CastToBot(), this, "", 0);
|
parse->EventBot(EVENT_NPC_SLAY, killer_mob->CastToBot(), this, "", 0);
|
||||||
killer_mob->TrySpellOnKill(killed_level, spell);
|
killer_mob->TrySpellOnKill(killed_level, spell);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2358,7 +2358,7 @@ bool BotDatabase::LoadLeaderIDByBotGroupID(const uint32 group_id, uint32& leader
|
|||||||
bool BotDatabase::LoadBotGroupNameByBotGroupID(const uint32 group_id, std::string& botgroup_name)
|
bool BotDatabase::LoadBotGroupNameByBotGroupID(const uint32 group_id, std::string& botgroup_name)
|
||||||
{
|
{
|
||||||
if (!group_id) {
|
if (!group_id) {
|
||||||
false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
query = fmt::format(
|
query = fmt::format(
|
||||||
|
|||||||
@ -2901,6 +2901,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
|||||||
since effect can potentially kill caster.
|
since effect can potentially kill caster.
|
||||||
*/
|
*/
|
||||||
case SE_Health_Transfer: {
|
case SE_Health_Transfer: {
|
||||||
|
if (caster) {
|
||||||
effect_value = spells[spell_id].limit_value[i];
|
effect_value = spells[spell_id].limit_value[i];
|
||||||
int64 amt = std::abs(caster->GetMaxHP() * effect_value / 1000);
|
int64 amt = std::abs(caster->GetMaxHP() * effect_value / 1000);
|
||||||
|
|
||||||
@ -2910,6 +2911,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
|||||||
else {
|
else {
|
||||||
HealDamage(amt, caster);
|
HealDamage(amt, caster);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user