заплатка для ОБР

This commit is contained in:
BIGZi0348
2025-03-10 22:05:42 +03:00
parent 05096bfd59
commit ceb7595e38
2 changed files with 6 additions and 2 deletions

View File

@@ -137,7 +137,7 @@ public sealed class ERTRecruitmentRule : StationEventSystem<ERTRecruitmentRuleCo
if (component.TargetStation != null)
AcceptERT(component.TargetStation.Value);
_recruitment.EndRecruitment(ERTRecruitmentRuleComponent.EventName);
_recruitment.EndRecruitment(ERTRecruitmentRuleComponent.EventName, component.OverallPlaytime);
ertsys.IsDisabled = true;
}

View File

@@ -67,8 +67,9 @@ public sealed class GhostRecruitmentSystem : EntitySystem
/// Arranges the ghosts that agreed by roles.
/// </summary>
/// <param name="recruitmentName">name of recruitment. <see cref="GhostRecruitmentSpawnPointComponent"/></param>
/// <param name="overallPlaytime">Minimal playtime to be eligible for recruitment.</param>
/// <returns>is success?</returns>
public bool EndRecruitment(string recruitmentName)
public bool EndRecruitment(string recruitmentName, TimeSpan? overallPlaytime)
{
var spawners = GetEventSpawners(recruitmentName).ToList();
@@ -88,6 +89,9 @@ public sealed class GhostRecruitmentSystem : EntitySystem
if (!TryComp<ActorComponent>(uid, out var actorComponent))
continue;
if (overallPlaytime != null && _playTimeTracking.GetOverallPlaytime(actorComponent.PlayerSession) < overallPlaytime)
continue;
// if there are too many recruited, then just skip
if (count >= spawners.Count || count >= maxCount)
continue;