Added some nullptr checks for ItemInst* in a few places (tradeskills.cpp - particularly augments - needs a better review)

This commit is contained in:
Uleat
2014-12-23 10:14:45 -05:00
parent ed257b0ef3
commit 34ab3e10f5
14 changed files with 123 additions and 46 deletions
+5
View File
@@ -695,6 +695,9 @@ bool LuaParser::SpellHasQuestSub(uint32 spell_id, QuestEventID evt) {
}
bool LuaParser::ItemHasQuestSub(ItemInst *itm, QuestEventID evt) {
if (itm == nullptr) {
return false;
}
evt = ConvertLuaEvent(evt);
if(evt >= _LargestEventID) {
return false;
@@ -738,6 +741,8 @@ void LuaParser::LoadGlobalPlayerScript(std::string filename) {
}
void LuaParser::LoadItemScript(std::string filename, ItemInst *item) {
if (item == nullptr)
return;
std::string package_name = "item_";
package_name += std::to_string(static_cast<long long>(item->GetID()));