From f2ad510c4d7f128deb5bb0fa547cc01b0bfb26ab Mon Sep 17 00:00:00 2001 From: RaidMax Date: Fri, 25 Feb 2022 08:22:40 -0600 Subject: [PATCH] fix issue with tempban not displaying properly --- GameFiles/IW4x/userraw/scripts/_integration.gsc | 17 +++++++++++------ SharedLibraryCore/Services/PenaltyService.cs | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/GameFiles/IW4x/userraw/scripts/_integration.gsc b/GameFiles/IW4x/userraw/scripts/_integration.gsc index eae7daa0..6674a36e 100644 --- a/GameFiles/IW4x/userraw/scripts/_integration.gsc +++ b/GameFiles/IW4x/userraw/scripts/_integration.gsc @@ -66,7 +66,12 @@ OnPlayerConnect() player thread OnPlayerSpawned(); player thread PlayerTrackingOnInterval(); - player ToggleNightMode(); + + // only toggle if it's enabled + if ( IsDefined( level.nightModeEnabled ) && level.nightModeEnabled ) + { + player ToggleNightMode(); + } } } @@ -590,8 +595,8 @@ HideImpl() } self SetClientDvar( "sv_cheats", 1 ); - self SetClientDvar( "cg_thirdperson", 1 ); - self SetClientDvar( "sv_cheats", 0 ); + self SetClientDvar( "cg_thirdperson", 1 ); + self SetClientDvar( "sv_cheats", 0 ); self.savedHealth = self.health; self.health = 9999; @@ -610,9 +615,9 @@ UnhideImpl() return; } - self SetClientDvar( "sv_cheats", 1 ); - self SetClientDvar( "cg_thirdperson", 0 ); - self SetClientDvar( "sv_cheats", 0 ); + self SetClientDvar( "sv_cheats", 1 ); + self SetClientDvar( "cg_thirdperson", 0 ); + self SetClientDvar( "sv_cheats", 0 ); self.health = self.savedHealth; self.isHidden = false; diff --git a/SharedLibraryCore/Services/PenaltyService.cs b/SharedLibraryCore/Services/PenaltyService.cs index 56b80217..5d74fc45 100644 --- a/SharedLibraryCore/Services/PenaltyService.cs +++ b/SharedLibraryCore/Services/PenaltyService.cs @@ -116,7 +116,7 @@ namespace SharedLibraryCore.Services } private static readonly EFPenalty.PenaltyType[] LinkedPenalties = - { EFPenalty.PenaltyType.Ban, EFPenalty.PenaltyType.Flag }; + { EFPenalty.PenaltyType.Ban, EFPenalty.PenaltyType.Flag, EFPenalty.PenaltyType.TempBan }; private static readonly Expression> Filter = p => LinkedPenalties.Contains(p.Type) && p.Active && (p.Expires == null || p.Expires > DateTime.UtcNow);