заплатка для ОБР
This commit is contained in:
@@ -137,7 +137,7 @@ public sealed class ERTRecruitmentRule : StationEventSystem<ERTRecruitmentRuleCo
|
|||||||
if (component.TargetStation != null)
|
if (component.TargetStation != null)
|
||||||
AcceptERT(component.TargetStation.Value);
|
AcceptERT(component.TargetStation.Value);
|
||||||
|
|
||||||
_recruitment.EndRecruitment(ERTRecruitmentRuleComponent.EventName);
|
_recruitment.EndRecruitment(ERTRecruitmentRuleComponent.EventName, component.OverallPlaytime);
|
||||||
ertsys.IsDisabled = true;
|
ertsys.IsDisabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,8 +67,9 @@ public sealed class GhostRecruitmentSystem : EntitySystem
|
|||||||
/// Arranges the ghosts that agreed by roles.
|
/// Arranges the ghosts that agreed by roles.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="recruitmentName">name of recruitment. <see cref="GhostRecruitmentSpawnPointComponent"/></param>
|
/// <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>
|
/// <returns>is success?</returns>
|
||||||
public bool EndRecruitment(string recruitmentName)
|
public bool EndRecruitment(string recruitmentName, TimeSpan? overallPlaytime)
|
||||||
{
|
{
|
||||||
var spawners = GetEventSpawners(recruitmentName).ToList();
|
var spawners = GetEventSpawners(recruitmentName).ToList();
|
||||||
|
|
||||||
@@ -88,6 +89,9 @@ public sealed class GhostRecruitmentSystem : EntitySystem
|
|||||||
if (!TryComp<ActorComponent>(uid, out var actorComponent))
|
if (!TryComp<ActorComponent>(uid, out var actorComponent))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (overallPlaytime != null && _playTimeTracking.GetOverallPlaytime(actorComponent.PlayerSession) < overallPlaytime)
|
||||||
|
continue;
|
||||||
|
|
||||||
// if there are too many recruited, then just skip
|
// if there are too many recruited, then just skip
|
||||||
if (count >= spawners.Count || count >= maxCount)
|
if (count >= spawners.Count || count >= maxCount)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user