aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Conditions/ConditionMgr.cpp
diff options
context:
space:
mode:
authorModoX <moardox@gmail.com>2021-10-25 16:24:51 +0200
committerGitHub <noreply@github.com>2021-10-25 16:24:51 +0200
commit03c0f787a1390eb50789f5bda104bbe40dda3c77 (patch)
tree952b3b87b1899d2438ddb94a087527d1e48b3722 /src/server/game/Conditions/ConditionMgr.cpp
parentf91faa161cf8f12cf066edf36e88b12f73c1f054 (diff)
Core/Conditions: Added conversation line source type (#27167)
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.cpp')
-rw-r--r--src/server/game/Conditions/ConditionMgr.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 88f0336ce4e..9a8abba5482 100644
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -20,6 +20,7 @@
#include "AreaTrigger.h"
#include "AreaTriggerDataStore.h"
#include "Containers.h"
+#include "ConversationDataStore.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "GameEventMgr.h"
@@ -79,6 +80,7 @@ char const* const ConditionMgr::StaticSourceTypeData[CONDITION_SOURCE_TYPE_MAX]
"Phase",
"Graveyard",
"AreaTrigger",
+ "ConversationLine"
};
ConditionMgr::ConditionTypeInfo const ConditionMgr::StaticConditionTypeData[CONDITION_MAX] =
@@ -1915,6 +1917,13 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
return false;
}
break;
+ case CONDITION_SOURCE_TYPE_CONVERSATION_LINE:
+ if (!sConversationDataStore->GetConversationLineTemplate(cond->SourceEntry))
+ {
+ TC_LOG_ERROR("sql.sql", "%s does not exist in `conversation_line_template`, ignoring.", cond->ToString().c_str());
+ return false;
+ }
+ break;
default:
TC_LOG_ERROR("sql.sql", "%s Invalid ConditionSourceType in `condition` table, ignoring.", cond->ToString().c_str());
return false;