Predict identity (#40185)

* crossing the pond

* share some station records

* share some criminal records

* single system

* comments

* minor touchups

* I always forget this part

* requested changes

* revert predicted spawn

* requested changes

---------

Co-authored-by: iaada <iaada@users.noreply.github.com>
This commit is contained in:
āda
2025-09-23 18:32:20 -05:00
committed by GitHub
parent dddb6163f5
commit 320e67a411
18 changed files with 354 additions and 337 deletions

View File

@@ -269,31 +269,4 @@ public sealed class CriminalRecordsConsoleSystem : SharedCriminalRecordsConsoleS
mob = user;
return true;
}
/// <summary>
/// Checks if the new identity's name has a criminal record attached to it, and gives the entity the icon that
/// belongs to the status if it does.
/// </summary>
public void CheckNewIdentity(EntityUid uid)
{
var name = Identity.Name(uid, EntityManager);
var xform = Transform(uid);
// TODO use the entity's station? Not the station of the map that it happens to currently be on?
var station = _station.GetStationInMap(xform.MapID);
if (station != null && _records.GetRecordByName(station.Value, name) is { } id)
{
if (_records.TryGetRecord<CriminalRecord>(new StationRecordKey(id, station.Value),
out var record))
{
if (record.Status != SecurityStatus.None)
{
_criminalRecords.SetCriminalIcon(name, record.Status, uid);
return;
}
}
}
RemComp<CriminalRecordComponent>(uid);
}
}