From 718b0e6bdd325c8308a7cd4b88ee71e3cdc11ee6 Mon Sep 17 00:00:00 2001 From: MitchesD Date: Thu, 3 Apr 2014 19:47:27 +0200 Subject: Core/SmartScripts: SMART_ACTION_EQUIP prevent to false errors --- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/server') diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 97e128361e4..993e6967ba5 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -992,17 +992,19 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } case SMART_ACTION_EQUIP: { - if (e.GetScriptType() == SMART_SCRIPT_TYPE_CREATURE) { int8 equipId = (int8)e.action.equip.entry; - EquipmentInfo const* einfo = sObjectMgr->GetEquipmentInfo(e.entryOrGuid, equipId); - if (!einfo) + + if (equipId) { - TC_LOG_ERROR("sql.sql", "SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id %u for creature %u, skipped.", equipId, e.entryOrGuid); - return false; + EquipmentInfo const* einfo = sObjectMgr->GetEquipmentInfo(e.entryOrGuid, equipId); + if (!einfo) + { + TC_LOG_ERROR("sql.sql", "SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id %u for creature %u, skipped.", equipId, e.entryOrGuid); + return false; + } } - } break; } -- cgit v1.2.3