clean up a bunch of R&D code (#13071)

* clean up a bunch of R&D code

* don't store components

* brug

* speedrun some sloth review
This commit is contained in:
Nemanja
2022-12-19 16:14:02 -05:00
committed by GitHub
parent f78dca8504
commit 0549b22cbc
12 changed files with 159 additions and 143 deletions

View File

@@ -1,6 +1,7 @@
using Content.Shared.Interaction;
using Content.Server.Research.Components;
using Content.Server.Popups;
using Content.Server.Research.Systems;
using Robust.Shared.Player;
namespace Content.Server.Research.Disk
@@ -8,6 +9,7 @@ namespace Content.Server.Research.Disk
public sealed class ResearchDiskSystem : EntitySystem
{
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly ResearchSystem _research = default!;
public override void Initialize()
{
base.Initialize();
@@ -22,7 +24,7 @@ namespace Content.Server.Research.Disk
if (!TryComp<ResearchServerComponent>(args.Target, out var server))
return;
server.Points += component.Points;
_research.ChangePointsOnServer(server.Owner, component.Points, server);
_popupSystem.PopupEntity(Loc.GetString("research-disk-inserted", ("points", component.Points)), args.Target.Value, args.User);
EntityManager.QueueDeleteEntity(uid);
}