From 89a16d0aec8dee0769df9776568b8cb83ca9b10a Mon Sep 17 00:00:00 2001 From: MSWS Date: Sat, 27 Jan 2024 18:50:38 -0800 Subject: [PATCH] Add valid check in NextFrame --- Source Code/NoBlock.cs | 2 ++ Source Code/NoBlock.csproj | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source Code/NoBlock.cs b/Source Code/NoBlock.cs index 012b0f9..8fff1e5 100644 --- a/Source Code/NoBlock.cs +++ b/Source Code/NoBlock.cs @@ -99,6 +99,8 @@ private HookResult Event_PlayerSpawn(EventPlayerSpawn @event, GameEventInfo info // This is called upon just after the player spawns private void PlayerSpawnNextFrame(CCSPlayerController player, CHandle pawn) { + if (!player.IsValid || !pawn.IsValid) + return; // Changes the player's collision to 16, allowing the player to pass through other players while still take damage from bullets and knife attacks pawn.Value.Collision.CollisionGroup = (byte)CollisionGroup.COLLISION_GROUP_DISSOLVING; diff --git a/Source Code/NoBlock.csproj b/Source Code/NoBlock.csproj index 86237e4..92072bb 100644 --- a/Source Code/NoBlock.csproj +++ b/Source Code/NoBlock.csproj @@ -7,9 +7,7 @@ - - YOUR PATH HERE/CounterStrikeSharp.API.dll - +