Fix antag objectives always overshooting MaxDifficulty (and kill tries20) (#29830)
* The death of try20 * Add integration test for traitor gamerule * Fix max difficulty being overshot * Check at least one objective is assigned * EntProtoId
This commit is contained in:
@@ -39,7 +39,8 @@ public sealed class AntagRandomObjectivesSystem : EntitySystem
|
||||
|
||||
for (var pick = 0; pick < set.MaxPicks && ent.Comp.MaxDifficulty > difficulty; pick++)
|
||||
{
|
||||
if (_objectives.GetRandomObjective(mindId, mind, set.Groups) is not {} objective)
|
||||
var remainingDifficulty = ent.Comp.MaxDifficulty - difficulty;
|
||||
if (_objectives.GetRandomObjective(mindId, mind, set.Groups, remainingDifficulty) is not { } objective)
|
||||
continue;
|
||||
|
||||
_mind.AddObjective(mindId, mind, objective);
|
||||
|
||||
Reference in New Issue
Block a user