Remove misc Startup/Shutdown overrides (#8113)

Co-authored-by: ike709 <ike709@github.com>
This commit is contained in:
ike709
2022-05-12 06:11:50 -05:00
committed by GitHub
parent 834e29d76a
commit a9c18acd35
7 changed files with 58 additions and 50 deletions

View File

@@ -53,6 +53,8 @@ namespace Content.Server.Ghost.Roles
SubscribeLocalEvent<GhostTakeoverAvailableComponent, MindAddedMessage>(OnMindAdded);
SubscribeLocalEvent<GhostTakeoverAvailableComponent, MindRemovedMessage>(OnMindRemoved);
SubscribeLocalEvent<GhostTakeoverAvailableComponent, MobStateChangedEvent>(OnMobStateChanged);
SubscribeLocalEvent<GhostRoleComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<GhostRoleComponent, ComponentShutdown>(OnShutdown);
_playerManager.PlayerStatusChanged += PlayerStatusChanged;
}
@@ -266,6 +268,18 @@ namespace Content.Server.Ghost.Roles
_ghostRoles.Clear();
_nextRoleIdentifier = 0;
}
private void OnInit(EntityUid uid, GhostRoleComponent role, ComponentInit args)
{
if (role.RoleRules == "")
role.RoleRules = Loc.GetString("ghost-role-component-default-rules");
RegisterGhostRole(role);
}
private void OnShutdown(EntityUid uid, GhostRoleComponent role, ComponentShutdown args)
{
UnregisterGhostRole(role);
}
}
[AnyCommand]