Skip to content

Commit

Permalink
Add valid check in NextFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Jan 28, 2024
1 parent 63f1ce1 commit 89a16d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Source Code/NoBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<CCSPlayerPawn> 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;

Expand Down
4 changes: 1 addition & 3 deletions Source Code/NoBlock.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
</PropertyGroup>

<ItemGroup>
<Reference Include="CounterStrikeSharp.API">
<HintPath>YOUR PATH HERE/CounterStrikeSharp.API.dll</HintPath>
</Reference>
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.141" />
</ItemGroup>

</Project>

0 comments on commit 89a16d0

Please sign in to comment.