aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities
diff options
context:
space:
mode:
authorModoX <moardox@gmail.com>2024-01-09 22:48:59 +0100
committerGitHub <noreply@github.com>2024-01-09 22:48:59 +0100
commitde23262c654ff208ae8ed75c815facf017634afe (patch)
tree4db08ef8ea2a1cce6b8513dc68cc1931f74b7a69 /src/server/game/Entities
parent10ac56512ea70d64ab7b9e538840d0589fb37e44 (diff)
Core/Conversation: Implemented conversation flags (#29552)
Diffstat (limited to 'src/server/game/Entities')
-rw-r--r--src/server/game/Entities/Conversation/Conversation.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/server/game/Entities/Conversation/Conversation.cpp b/src/server/game/Entities/Conversation/Conversation.cpp
index a83ce8c0d05..11801ca0763 100644
--- a/src/server/game/Entities/Conversation/Conversation.cpp
+++ b/src/server/game/Entities/Conversation/Conversation.cpp
@@ -230,13 +230,17 @@ void Conversation::Create(ObjectGuid::LowType lowGuid, uint32 conversationEntry,
bool Conversation::Start()
{
- for (UF::ConversationLine const& line : *m_conversationData->Lines)
+ ConversationTemplate const* conversationTemplate = sConversationDataStore->GetConversationTemplate(GetEntry()); // never null, already checked in ::Create / ::CreateConversation
+ if (!conversationTemplate->Flags.HasFlag(ConversationFlags::AllowWithoutSpawnedActor))
{
- UF::ConversationActor const* actor = line.ActorIndex < m_conversationData->Actors.size() ? &m_conversationData->Actors[line.ActorIndex] : nullptr;
- if (!actor || (!actor->CreatureID && actor->ActorGUID.IsEmpty() && !actor->NoActorObject))
+ for (UF::ConversationLine const& line : *m_conversationData->Lines)
{
- TC_LOG_ERROR("entities.conversation", "Failed to create conversation (Id: {}) due to missing actor (Idx: {}).", GetEntry(), line.ActorIndex);
- return false;
+ UF::ConversationActor const* actor = line.ActorIndex < m_conversationData->Actors.size() ? &m_conversationData->Actors[line.ActorIndex] : nullptr;
+ if (!actor || (!actor->CreatureID && actor->ActorGUID.IsEmpty() && !actor->NoActorObject))
+ {
+ TC_LOG_ERROR("entities.conversation", "Failed to create conversation (Id: {}) due to missing actor (Idx: {}).", GetEntry(), line.ActorIndex);
+ return false;
+ }
}
}