clean up infinite researchsystem shitcode (#13136)

* clean up infinite researchsystem shitcode

* fml some more shit

* make syncing work logically

* naming naming naming
This commit is contained in:
Nemanja
2022-12-25 16:22:23 -05:00
committed by GitHub
parent 9afbdf6a17
commit 4eee1ee9b2
23 changed files with 497 additions and 293 deletions

View File

@@ -4,7 +4,6 @@ using Content.Server.MachineLinking.Components;
using Content.Server.MachineLinking.Events;
using Content.Server.Paper;
using Content.Server.Power.Components;
using Content.Server.Research.Components;
using Content.Server.Research.Systems;
using Content.Server.UserInterface;
using Content.Server.Xenoarchaeology.Equipment.Components;
@@ -20,7 +19,6 @@ using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.Physics.Events;
using Robust.Shared.Player;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
@@ -333,7 +331,10 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
/// <param name="args"></param>
private void OnDestroyButton(EntityUid uid, AnalysisConsoleComponent component, AnalysisConsoleDestroyButtonPressedMessage args)
{
if (!TryComp<ResearchClientComponent>(uid, out var client) || client.Server is not { } server || component.AnalyzerEntity == null)
if (component.AnalyzerEntity == null)
return;
if (!_research.TryGetClientServer(uid, out var server, out var serverComponent))
return;
var entToDestroy = GetArtifactForAnalysis(component.AnalyzerEntity);
@@ -346,7 +347,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
ResetAnalyzer(component.AnalyzerEntity.Value);
}
_research.ChangePointsOnServer(server.Owner, _artifact.GetResearchPointValue(entToDestroy.Value), server);
_research.AddPointsToServer(server.Value, _artifact.GetResearchPointValue(entToDestroy.Value), serverComponent);
EntityManager.DeleteEntity(entToDestroy.Value);
_audio.PlayPvs(component.DestroySound, component.AnalyzerEntity.Value, AudioParams.Default.WithVolume(2f));