fix nulls getting displayed

This commit is contained in:
Axwabo 2023-02-25 18:20:23 +01:00
parent 58c39b0775
commit 35c19bfa38

View File

@ -1,4 +1,5 @@
using Axwabo.Helpers;
using PlayerRoles;
using PlayerRoles.PlayableScps;
using PlayerStatsSystem;
using PluginAPI.Core;
@ -41,6 +42,8 @@ public sealed class DeathLogPlugin {
[PluginEvent(ServerEventType.PlayerDying)]
private void OnPlayerDeath(Player player, Player attacker, DamageHandlerBase handler) {
if (player.Role == RoleTypeId.None || string.IsNullOrEmpty(player.ReferenceHub.nicknameSync._myNickSync))
return;
if (attacker != null && handler is AttackerDamageHandler adh)
LogHandler.LogAttackerDeathMessage(player, attacker, adh, Config.VisibilityRequirement, Config.KillOnSightPermitted, Config.DefaultFontSizeScalar);
else if (Config.LogSimpleDeaths)