Role subtypes (#35359)

This commit is contained in:
Errant
2025-04-16 19:04:48 +02:00
committed by GitHub
parent 7aa0c7562e
commit fb388d2265
20 changed files with 414 additions and 121 deletions

View File

@@ -235,12 +235,16 @@ public sealed class AdminSystem : EntitySystem
// Starting role, antagonist status and role type
RoleTypePrototype roleType = new();
var startingRole = string.Empty;
LocId? subtype = null;
if (_minds.TryGetMind(session, out var mindId, out var mindComp) && mindComp is not null)
{
sortWeight = _role.GetRoleCompByTime(mindComp)?.Comp.SortWeight ?? 0;
if (_proto.TryIndex(mindComp.RoleType, out var role))
{
roleType = role;
subtype = mindComp.Subtype;
}
else
Log.Error($"{ToPrettyString(mindId)} has invalid Role Type '{mindComp.RoleType}'. Displaying '{Loc.GetString(roleType.Name)}' instead");
@@ -269,6 +273,7 @@ public sealed class AdminSystem : EntitySystem
startingRole,
antag,
roleType,
subtype,
sortWeight,
GetNetEntity(session?.AttachedEntity),
data.UserId,