Refactor actions to be entities with components (#19900)

This commit is contained in:
DrSmugleaf
2023-09-08 18:16:05 -07:00
committed by GitHub
parent e18f731b91
commit c71f97e3a2
210 changed files with 10693 additions and 11714 deletions

View File

@@ -57,8 +57,14 @@ public sealed partial class BorgSystem
private void OnSelectableInstalled(EntityUid uid, SelectableBorgModuleComponent component, ref BorgModuleInstalledEvent args)
{
var chassis = args.ChassisEnt;
component.ModuleSwapAction.EntityIcon = uid;
_actions.AddAction(chassis, component.ModuleSwapAction, uid);
var action = _actions.AddAction(chassis, ref component.ModuleSwapActionEntity, component.ModuleSwapActionId, uid);
if (action != null)
{
action.EntityIcon = uid;
Dirty(component.ModuleSwapActionEntity!.Value, action);
}
SelectModule(chassis, uid, moduleComp: component);
}