From 92a1c7373afdfbb2c8a021b20d45d4d161f1f56a Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Thu, 19 Dec 2024 12:48:26 -0500 Subject: [PATCH] Also check total selections --- Content.Server/Traits/TraitSystem.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Content.Server/Traits/TraitSystem.cs b/Content.Server/Traits/TraitSystem.cs index 6a6cd39d0b8..7a028b381ad 100644 --- a/Content.Server/Traits/TraitSystem.cs +++ b/Content.Server/Traits/TraitSystem.cs @@ -46,6 +46,7 @@ public override void Initialize() private void OnPlayerSpawnComplete(PlayerSpawnCompleteEvent args) { var pointsTotal = _configuration.GetCVar(CCVars.GameTraitsDefaultPoints); + var traitSelections = _configuration.GetCVar(CCVars.GameTraitsMax); foreach (var traitId in args.Profile.TraitPreferences) { @@ -65,11 +66,12 @@ private void OnPlayerSpawnComplete(PlayerSpawnCompleteEvent args) // To check for cheaters. :FaridaBirb.png: pointsTotal += traitPrototype.Points; + --traitSelections; AddTrait(args.Mob, traitPrototype); } - if (pointsTotal < 0) + if (pointsTotal < 0 || traitSelections < 0) PunishCheater(args.Mob); }