Fixed some death messages showing up even when they are disabled. (#5153)
This commit is contained in:
parent
01a4e696b3
commit
c729d7abde
@ -186,6 +186,11 @@ void cWorld::BroadcastBossBarUpdateHealth(const cEntity & a_Entity, UInt32 a_Uni
|
||||
|
||||
void cWorld::BroadcastChat(const AString & a_Message, const cClientHandle * a_Exclude, eMessageType a_ChatPrefix)
|
||||
{
|
||||
if ((a_ChatPrefix == mtDeath) && !ShouldBroadcastDeathMessages())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ForClientsInWorld(*this, a_Exclude, [&](cClientHandle & a_Client)
|
||||
{
|
||||
a_Client.SendChat(a_Message, a_ChatPrefix);
|
||||
|
@ -809,7 +809,7 @@ void cPlayer::KilledBy(TakeDamageInfo & a_TDI)
|
||||
SaveToDisk(); // Save it, yeah the world is a tough place !
|
||||
cPluginManager * PluginManager = cRoot::Get()->GetPluginManager();
|
||||
|
||||
if ((a_TDI.Attacker == nullptr) && m_World->ShouldBroadcastDeathMessages())
|
||||
if (a_TDI.Attacker == nullptr)
|
||||
{
|
||||
const AString DamageText = [&]
|
||||
{
|
||||
@ -845,10 +845,6 @@ void cPlayer::KilledBy(TakeDamageInfo & a_TDI)
|
||||
GetWorld()->BroadcastChatDeath(DeathMessage);
|
||||
}
|
||||
}
|
||||
else if (a_TDI.Attacker == nullptr) // && !m_World->ShouldBroadcastDeathMessages() by fallthrough
|
||||
{
|
||||
// no-op
|
||||
}
|
||||
else if (a_TDI.Attacker->IsPlayer())
|
||||
{
|
||||
cPlayer * Killer = static_cast<cPlayer *>(a_TDI.Attacker);
|
||||
|
Loading…
Reference in New Issue
Block a user