Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
fix: Random errors on client disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
K4ryuu committed Nov 24, 2023
1 parent 2a05273 commit 665a0df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- fix: 161 Segmentation fault
- fix: Time updates on !time command
- fix: Alive time not saved properly
- fix: Random errors on client disconnect

- -- 2023.10.21 - V1.3.3

Expand Down
5 changes: 4 additions & 1 deletion src/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ private void SetupGameEvents()
});
RegisterEventHandler<EventPlayerTeam>((@event, info) =>
{
if ((CsTeam)@event.Team == CsTeam.None)
return HookResult.Continue;
if (!Config.GeneralSettings.ModuleTimes)
{
Log("EventPlayerTeam: ModuleTimes is not enabled.", LogLevel.Debug);
Expand Down Expand Up @@ -424,7 +427,7 @@ private void SetupGameEvents()
CCSPlayerController killerController = @event.Attacker;
CCSPlayerController assisterController = @event.Assister;
if (!victimController.IsValid)
if (victimController == null || !victimController.IsValid || victimController.UserId <= 0)
return HookResult.Continue;
if (!victimController.IsBot)
Expand Down

0 comments on commit 665a0df

Please sign in to comment.