fix issue with tempban not displaying properly

This commit is contained in:
RaidMax 2022-02-25 08:22:40 -06:00
parent 4ace476242
commit bd6c0dd5be
2 changed files with 12 additions and 7 deletions

View File

@ -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;

View File

@ -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<Func<EFPenalty, bool>> Filter = p =>
LinkedPenalties.Contains(p.Type) && p.Active && (p.Expires == null || p.Expires > DateTime.UtcNow);