Core/Texts: Fix nullptr when no BroadcastText is found

Port From (https://github.com/TrinityCore/TrinityCore/commit/05c8ad26c2f8c397ffcad743b1825bd47f719037)
This commit is contained in:
Hondacrx
2024-11-11 21:15:39 -05:00
parent 37529b12bc
commit fb7b17b908
+2 -2
View File
@@ -212,12 +212,12 @@ namespace Game
if (srcPlr != null) 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); SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly);
} }
else 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); SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly);
} }