aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiacomo Pozzoni <giacomopoz@gmail.com>2021-08-30 11:20:31 +0200
committerGitHub <noreply@github.com>2021-08-30 11:20:31 +0200
commitcb764a932d640698ed7cd92dd1e02d08243a8ad3 (patch)
tree1d3a12e4c1185e11bed4f182819b74ace63665c0
parent0fad28e4ab4d7143d629a8f28883a46823680fde (diff)
Core/SAI: Change error to warning for unused parameters (#26848)
Change error to warning for unused parameters and load the scripts instead of skipping them
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index d00d483e8bf..bcd764b0be8 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -794,19 +794,17 @@ bool SmartAIMgr::CheckUnusedEventParams(SmartScriptHolder const& e)
static size_t rawCount = sizeof(SmartEvent::raw) / sizeof(uint32);
size_t paramsCount = paramsStructSize / sizeof(uint32);
- bool valid = true;
for (size_t index = paramsCount; index < rawCount; index++)
{
uint32 value = ((uint32*)&e.event.raw)[index];
if (value != 0)
{
- TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has unused event_param%zu with value %u, it must be 0, skipped.",
+ TC_LOG_WARN("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has unused event_param%zu with value %u, it should be 0.",
e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), index + 1, value);
- valid = false;
}
}
- return valid;
+ return true;
}
bool SmartAIMgr::CheckUnusedActionParams(SmartScriptHolder const& e)
@@ -968,19 +966,17 @@ bool SmartAIMgr::CheckUnusedActionParams(SmartScriptHolder const& e)
static size_t rawCount = sizeof(SmartAction::raw) / sizeof(uint32);
size_t paramsCount = paramsStructSize / sizeof(uint32);
- bool valid = true;
for (size_t index = paramsCount; index < rawCount; index++)
{
uint32 value = ((uint32*)&e.action.raw)[index];
if (value != 0)
{
- TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has unused action_param%zu with value %u, it must be 0, skipped.",
+ TC_LOG_WARN("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has unused action_param%zu with value %u, it should be 0.",
e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), index + 1, value);
- valid = false;
}
}
- return valid;
+ return true;
}
bool SmartAIMgr::CheckUnusedTargetParams(SmartScriptHolder const& e)
@@ -1031,19 +1027,17 @@ bool SmartAIMgr::CheckUnusedTargetParams(SmartScriptHolder const& e)
static size_t rawCount = sizeof(SmartTarget::raw) / sizeof(uint32);
size_t paramsCount = paramsStructSize / sizeof(uint32);
- bool valid = true;
for (size_t index = paramsCount; index < rawCount; index++)
{
uint32 value = ((uint32*)&e.target.raw)[index];
if (value != 0)
{
- TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has unused target_param%zu with value %u, it must be 0, skipped.",
+ TC_LOG_WARN("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has unused target_param%zu with value %u, it should be 0.",
e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), index + 1, value);
- valid = false;
}
}
- return valid;
+ return true;
}
bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)