mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01: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);
|
||||
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)
|
||||
{
|
||||
if (!group_id) {
|
||||
false;
|
||||
return false;
|
||||
}
|
||||
|
||||
query = fmt::format(
|
||||
|
||||
@ -2901,14 +2901,16 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
since effect can potentially kill caster.
|
||||
*/
|
||||
case SE_Health_Transfer: {
|
||||
effect_value = spells[spell_id].limit_value[i];
|
||||
int64 amt = std::abs(caster->GetMaxHP() * effect_value / 1000);
|
||||
if (caster) {
|
||||
effect_value = spells[spell_id].limit_value[i];
|
||||
int64 amt = std::abs(caster->GetMaxHP() * effect_value / 1000);
|
||||
|
||||
if (effect_value < 0) {
|
||||
Damage(caster, amt, spell_id, spell.skill, false, buffslot, false);
|
||||
}
|
||||
else {
|
||||
HealDamage(amt, caster);
|
||||
if (effect_value < 0) {
|
||||
Damage(caster, amt, spell_id, spell.skill, false, buffslot, false);
|
||||
}
|
||||
else {
|
||||
HealDamage(amt, caster);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user