From 2838a622647a1e12ec483b59440c7d0414dc14fa Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Fri, 3 Oct 2014 16:02:11 +0200 Subject: Core/Sai: Added new error log for action SMART_ACTION_TALK --- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index c12221165d4..a4f9b45a6d5 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -700,6 +700,21 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) switch (e.GetActionType()) { + case SMART_ACTION_TALK: + { + if (e.GetScriptType() == SMART_SCRIPT_TYPE_CREATURE && e.entryOrGuid >= 0) + { + CreatureTextMap::const_iterator sList = sCreatureTextMgr->GetTextMap().find(e.entryOrGuid); + if (sList == sCreatureTextMgr->GetTextMap().end()) + TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u could not find Text for Creature", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); + + CreatureTextHolder const& textHolder = sList->second; + CreatureTextHolder::const_iterator itr = textHolder.find(e.action.talk.textGroupID); + if (itr == textHolder.end()) + TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u could not find TextGroup %u for Creature", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.talk.textGroupID); + } + break; + } case SMART_ACTION_SET_FACTION: if (e.action.faction.factionID && !sFactionTemplateStore.LookupEntry(e.action.faction.factionID)) { @@ -1109,7 +1124,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_ACTION_SET_NPC_FLAG: case SMART_ACTION_ADD_NPC_FLAG: case SMART_ACTION_REMOVE_NPC_FLAG: - case SMART_ACTION_TALK: case SMART_ACTION_SIMPLE_TALK: case SMART_ACTION_CROSS_CAST: case SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST: -- cgit v1.2.3 From 758b8ee1646c3e6386a63432f0a6d77ae1ef01c0 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Thu, 2 Oct 2014 23:12:30 +0200 Subject: Core/Brewfest: Fix typo in b74ef3f3ca277e7ce1bca7563fb0e9affbaf1a5a (thx to Gooyeth) --- src/server/scripts/Spells/spell_holiday.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index 126aa561c05..5c84f3045f8 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -759,7 +759,7 @@ enum RamBlub SAY_BARLEYBREW_1 = 23464, SAY_BARLEYBREW_2 = 23465, SAY_BARLEYBREW_3 = 23466, - SAY_BARLEYBREW_4 = 23467, + SAY_BARLEYBREW_4 = 22941, // Bark for the Thunderbrews! SAY_THUNDERBREWS_1 = 23467, -- cgit v1.2.3 From 6ef51481eba65803c613f358f593050a427280af Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Fri, 3 Oct 2014 16:07:11 +0200 Subject: Core: Fix crash --- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index a4f9b45a6d5..272c563557d 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -706,12 +706,18 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) { CreatureTextMap::const_iterator sList = sCreatureTextMgr->GetTextMap().find(e.entryOrGuid); if (sList == sCreatureTextMgr->GetTextMap().end()) - TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u could not find Text for Creature", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); + { + TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u could not find Text for Creature, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); + return false; + } CreatureTextHolder const& textHolder = sList->second; CreatureTextHolder::const_iterator itr = textHolder.find(e.action.talk.textGroupID); if (itr == textHolder.end()) - TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u could not find TextGroup %u for Creature", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.talk.textGroupID); + { + TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u could not find TextGroup %u for Creature , skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.talk.textGroupID); + return false; + } } break; } -- cgit v1.2.3 From 98257b94728223ff027c3696b630462288c85255 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Fri, 3 Oct 2014 16:20:12 +0200 Subject: Core/Sai: Added SMART_ACTION_TALK error log also for -guid creature --- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 272c563557d..a1f24952d8f 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -702,12 +702,21 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) { case SMART_ACTION_TALK: { - if (e.GetScriptType() == SMART_SCRIPT_TYPE_CREATURE && e.entryOrGuid >= 0) + if (e.GetScriptType() == SMART_SCRIPT_TYPE_CREATURE) { - CreatureTextMap::const_iterator sList = sCreatureTextMgr->GetTextMap().find(e.entryOrGuid); + uint32 entry = 0; + if (e.entryOrGuid >= 0) + entry = e.entryOrGuid; + else + { + if (CreatureData const* creatureData = sObjectMgr->GetCreatureData(uint32(abs(e.entryOrGuid)))) + entry = creatureData->id; + } + + CreatureTextMap::const_iterator sList = sCreatureTextMgr->GetTextMap().find(entry); if (sList == sCreatureTextMgr->GetTextMap().end()) { - TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u could not find Text for Creature, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); + TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u could not find Text for Creature %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry); return false; } @@ -715,7 +724,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) CreatureTextHolder::const_iterator itr = textHolder.find(e.action.talk.textGroupID); if (itr == textHolder.end()) { - TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u could not find TextGroup %u for Creature , skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.talk.textGroupID); + TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u could not find TextGroup %u for Creature %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.talk.textGroupID, entry); return false; } } -- cgit v1.2.3