From fb7b17b90838c7f8652e4281415297e8d1d8ef47 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Mon, 11 Nov 2024 21:15:39 -0500 Subject: [PATCH] Core/Texts: Fix nullptr when no BroadcastText is found Port From (https://github.com/TrinityCore/TrinityCore/commit/05c8ad26c2f8c397ffcad743b1825bd47f719037) --- Source/Game/Text/CreatureTextManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Game/Text/CreatureTextManager.cs b/Source/Game/Text/CreatureTextManager.cs index b5c42aaff..db7953a45 100644 --- a/Source/Game/Text/CreatureTextManager.cs +++ b/Source/Game/Text/CreatureTextManager.cs @@ -212,12 +212,12 @@ namespace Game if (srcPlr != null) { - CreatureTextBuilder builder = new(source, finalSource, finalSource.GetGender(), finalType, textEntry.groupId, textEntry.id, finalLang, whisperTarget, textEntry.BroadcastTextId, (ushort)textEntry.emote, finalSound, finalPlayType, (uint)bct.ConditionID); + CreatureTextBuilder builder = new(source, finalSource, finalSource.GetGender(), finalType, textEntry.groupId, textEntry.id, finalLang, whisperTarget, textEntry.BroadcastTextId, (ushort)textEntry.emote, finalSound, finalPlayType, (uint)(bct != null ? bct.ConditionID : 0)); SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly); } else { - CreatureTextBuilder builder = new(finalSource, finalSource, finalSource.GetGender(), finalType, textEntry.groupId, textEntry.id, finalLang, whisperTarget, textEntry.BroadcastTextId, (ushort)textEntry.emote, finalSound, finalPlayType, (uint)bct.ConditionID); + CreatureTextBuilder builder = new(finalSource, finalSource, finalSource.GetGender(), finalType, textEntry.groupId, textEntry.id, finalLang, whisperTarget, textEntry.BroadcastTextId, (ushort)textEntry.emote, finalSound, finalPlayType, (uint)(bct != null ? bct.ConditionID : 0)); SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly); }