Sentry turrets - Part 3: Turret AI (#35058)
* Initial commit * Updated Access/command.yml * Fix for Access/AccessLevelPrototype.cs * Added silicon access levels to admin items * Included self-recharging battery changes * Revert "Included self-recharging battery changes" * Addressed reviewers comments * Additional reviewer comments
This commit is contained in:
@@ -31,7 +31,7 @@ public sealed class IdCardSystem : SharedIdCardSystem
|
||||
private void OnMicrowaved(EntityUid uid, IdCardComponent component, BeingMicrowavedEvent args)
|
||||
{
|
||||
if (!component.CanMicrowave || !TryComp<MicrowaveComponent>(args.Microwave, out var micro) || micro.Broken)
|
||||
return;
|
||||
return;
|
||||
|
||||
if (TryComp<AccessComponent>(uid, out var access))
|
||||
{
|
||||
@@ -78,7 +78,12 @@ public sealed class IdCardSystem : SharedIdCardSystem
|
||||
}
|
||||
|
||||
// Give them a wonderful new access to compensate for everything
|
||||
var random = _random.Pick(_prototypeManager.EnumeratePrototypes<AccessLevelPrototype>().ToArray());
|
||||
var ids = _prototypeManager.EnumeratePrototypes<AccessLevelPrototype>().Where(x => x.CanAddToIdCard).ToArray();
|
||||
|
||||
if (ids.Length == 0)
|
||||
return;
|
||||
|
||||
var random = _random.Pick(ids);
|
||||
|
||||
access.Tags.Add(random.ID);
|
||||
Dirty(uid, access);
|
||||
|
||||
Reference in New Issue
Block a user