Fix for forage crash

This commit is contained in:
KimLS
2014-09-07 22:41:42 -07:00
parent b392d16808
commit a3b54e5cae
2 changed files with 11 additions and 7 deletions
+10 -6
View File
@@ -356,9 +356,11 @@ void Client::GoFish()
inst = m_inv.GetItem(MainCursor);
}
std::vector<EQEmu::Any> args;
args.push_back(inst);
parse->EventPlayer(EVENT_FISH_SUCCESS, this, "", inst->GetID(), &args);
if(inst) {
std::vector<EQEmu::Any> args;
args.push_back(inst);
parse->EventPlayer(EVENT_FISH_SUCCESS, this, "", inst->GetID(), &args);
}
}
}
else
@@ -470,9 +472,11 @@ void Client::ForageItem(bool guarantee) {
inst = m_inv.GetItem(MainCursor);
}
std::vector<EQEmu::Any> args;
args.push_back(inst);
parse->EventPlayer(EVENT_FORAGE_SUCCESS, this, "", inst->GetID(), &args);
if(inst) {
std::vector<EQEmu::Any> args;
args.push_back(inst);
parse->EventPlayer(EVENT_FORAGE_SUCCESS, this, "", inst->GetID(), &args);
}
}
int ChanceSecondForage = aabonuses.ForageAdditionalItems + itembonuses.ForageAdditionalItems + spellbonuses.ForageAdditionalItems;