Core/SAI: Fix some weird code in SmartAIMgr::IsTextValid

Additions to cb0e6cac63
This commit is contained in:
DDuarte
2015-07-19 21:54:48 +01:00
parent 4ee4cffb49
commit 57da378dea

View File

@@ -1270,11 +1270,11 @@ bool SmartAIMgr::IsTextValid(SmartScriptHolder const& e, uint32 id)
default:
if (e.entryOrGuid < 0)
{
entry = uint32(-e.entryOrGuid);
CreatureData const* data = sObjectMgr->GetCreatureData(entry);
ObjectGuid::LowType guid = ObjectGuid::LowType(-e.entryOrGuid);
CreatureData const* data = sObjectMgr->GetCreatureData(guid);
if (!data)
{
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry " SI64FMTD " SourceType %u Event %u Action %u using non-existent Creature guid " UI64FMTD ", skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry " SI64FMTD " SourceType %u Event %u Action %u using non-existent Creature guid " UI64FMTD ", skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), guid);
return false;
}
else