Skip to content

Commit d0d2adc

Browse files
authored
OnTakeDamage sanity check
Signed-off-by: Hackmastr <[email protected]>
1 parent faf9ded commit d0d2adc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

BasicAdmin/BasicAdmin.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ private static HookResult OnTakeDamage(DynamicHook hook)
103103

104104
var pawn = Utilities.GetEntityFromIndex<CCSPlayerPawn>((int)entindex);
105105

106-
if (pawn.OriginalController.Value is not { } player)
106+
if (pawn?.OriginalController?.Value is not { } player)
107107
return HookResult.Continue;
108108

109109
if (ActiveGodMode.ContainsKey(player.Handle))
@@ -808,4 +808,4 @@ public void OnCommsCommand(CCSPlayerController? caller, CommandInfo info)
808808

809809
internal static string FormatMessage(string message) => $" {ChatColors.Lime}[BasicAdmin]{ChatColors.Default} {message}";
810810
private string FormatAdminMessage(string message) => $" {Config.AdminTag} {message}";
811-
}
811+
}

0 commit comments

Comments
 (0)