mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
Might fix nukie commander not spawning (#5146)
* Might fix current commander whitelist * Added missing DV comments
This commit is contained in:
@@ -172,7 +172,7 @@ public sealed class PlayTimeTrackingSystem : EntitySystem
|
||||
_tracking.QueueRefreshTrackers(ev.PlayerSession);
|
||||
// Send timers to client when they join lobby, so the UIs are up-to-date.
|
||||
_tracking.QueueSendTimers(ev.PlayerSession);
|
||||
_tracking.QueueSendWhitelist(ev.PlayerSession); // Nyanotrasen - Send whitelist status
|
||||
_tracking.QueueSendWhitelist(ev.PlayerSession); // DeltaV - Send whitelist status
|
||||
}
|
||||
|
||||
private void OnStationJobsGetCandidates(ref StationJobsGetCandidatesEvent ev)
|
||||
@@ -258,7 +258,7 @@ public sealed class PlayTimeTrackingSystem : EntitySystem
|
||||
_prototypes,
|
||||
(HumanoidCharacterProfile?)
|
||||
_preferencesManager.GetPreferences(player.UserId).SelectedCharacter,
|
||||
isWhitelisted: isWhitelisted);
|
||||
isWhitelisted: isWhitelisted); // DeltaV
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -278,6 +278,7 @@ public sealed class PlayTimeTrackingSystem : EntitySystem
|
||||
playTimes = new Dictionary<string, TimeSpan>();
|
||||
}
|
||||
|
||||
var isWhitelisted = player.ContentData()?.Whitelisted ?? false; // DeltaV - Whitelist requirement
|
||||
var requirements = _roles.GetRoleRequirements(antag);
|
||||
return JobRequirements.TryRequirementsMet(
|
||||
requirements,
|
||||
@@ -286,7 +287,8 @@ public sealed class PlayTimeTrackingSystem : EntitySystem
|
||||
EntityManager,
|
||||
_prototypes,
|
||||
(HumanoidCharacterProfile?)
|
||||
_preferencesManager.GetPreferences(player.UserId).SelectedCharacter);
|
||||
_preferencesManager.GetPreferences(player.UserId).SelectedCharacter,
|
||||
isWhitelisted: isWhitelisted); // DeltaV
|
||||
}
|
||||
|
||||
public HashSet<ProtoId<JobPrototype>> GetDisallowedJobs(ICommonSession player)
|
||||
|
||||
@@ -26,7 +26,7 @@ public static class JobRequirements
|
||||
{
|
||||
var sys = entManager.System<SharedRoleSystem>();
|
||||
var requirements = sys.GetRoleRequirements(job);
|
||||
return TryRequirementsMet(requirements, playTimes, out reason, entManager, protoManager, profile, isWhitelisted: isWhitelisted);
|
||||
return TryRequirementsMet(requirements, playTimes, out reason, entManager, protoManager, profile, isWhitelisted: isWhitelisted); // DeltaV
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -43,7 +43,7 @@ public static class JobRequirements
|
||||
IEntityManager entManager,
|
||||
IPrototypeManager protoManager,
|
||||
HumanoidCharacterProfile? profile,
|
||||
bool isWhitelisted = false)
|
||||
bool isWhitelisted = false) // DeltaV
|
||||
{
|
||||
reason = null;
|
||||
if (requirements == null)
|
||||
@@ -51,7 +51,7 @@ public static class JobRequirements
|
||||
|
||||
foreach (var requirement in requirements)
|
||||
{
|
||||
if (!requirement.Check(entManager, protoManager, profile, playTimes, out reason, isWhitelisted))
|
||||
if (!requirement.Check(entManager, protoManager, profile, playTimes, out reason, isWhitelisted)) // DeltaV
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public sealed partial class WhitelistRequirement : JobRequirement
|
||||
if (isWhitelisted)
|
||||
return true;
|
||||
|
||||
reason = FormattedMessage.FromMarkup(Loc.GetString("playtime-deny-reason-not-whitelisted"));
|
||||
reason = FormattedMessage.FromMarkupOrThrow(Loc.GetString("playtime-deny-reason-not-whitelisted"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user