diff options
author | ModoX <moardox@gmail.com> | 2021-10-25 16:24:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-25 16:24:51 +0200 |
commit | 03c0f787a1390eb50789f5bda104bbe40dda3c77 (patch) | |
tree | 952b3b87b1899d2438ddb94a087527d1e48b3722 /src/server/game/Conditions | |
parent | f91faa161cf8f12cf066edf36e88b12f73c1f054 (diff) |
Core/Conditions: Added conversation line source type (#27167)
Diffstat (limited to 'src/server/game/Conditions')
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 9 | ||||
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.h | 3 |
2 files changed, 11 insertions, 1 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; diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 5cfb0cfb3e9..3ce9b8564e2 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -169,7 +169,8 @@ enum ConditionSourceType CONDITION_SOURCE_TYPE_PHASE = 26, CONDITION_SOURCE_TYPE_GRAVEYARD = 27, CONDITION_SOURCE_TYPE_AREATRIGGER = 28, - CONDITION_SOURCE_TYPE_MAX = 29 // MAX + CONDITION_SOURCE_TYPE_CONVERSATION_LINE = 29, + CONDITION_SOURCE_TYPE_MAX = 30 // MAX }; enum RelationType |