mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
[Cleanup] Fix possible nullptr in quest::addloot() (#3303)
# Notes - We didn't check for `owner` before calling `owner->IsNPC()`.
This commit is contained in:
parent
03c158b674
commit
1c9ea57a4e
@ -405,13 +405,28 @@ void QuestManager::selfcast(int spell_id) {
|
|||||||
initiator->SpellFinished(spell_id, initiator, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty);
|
initiator->SpellFinished(spell_id, initiator, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::addloot(int item_id, int charges, bool equipitem, int aug1, int aug2, int aug3, int aug4, int aug5, int aug6) {
|
void QuestManager::addloot(
|
||||||
|
int item_id,
|
||||||
|
int charges,
|
||||||
|
bool equipitem,
|
||||||
|
int aug1,
|
||||||
|
int aug2,
|
||||||
|
int aug3,
|
||||||
|
int aug4,
|
||||||
|
int aug5,
|
||||||
|
int aug6
|
||||||
|
) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
if (!owner) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (item_id != 0) {
|
if (item_id != 0) {
|
||||||
if(owner->IsNPC())
|
if (owner->IsNPC()) {
|
||||||
owner->CastToNPC()->AddItem(item_id, charges, equipitem, aug1, aug2, aug3, aug4, aug5, aug6);
|
owner->CastToNPC()->AddItem(item_id, charges, equipitem, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void QuestManager::Zone(const char *zone_name) {
|
void QuestManager::Zone(const char *zone_name) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user