From: Plykiya <58439124+Plykiya@users.noreply.github.com> Date: Sun, 2 Feb 2025 19:38:34 +0000 (-0800) Subject: Fixes debug assertion thrown when spiking with pills (#34813) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=95b863dd2b4dd99becf567f5e15ec5b71a8a2954;p=space-station-14.git Fixes debug assertion thrown when spiking with pills (#34813) --- diff --git a/Content.Shared/Chemistry/EntitySystems/SolutionSpikerSystem.cs b/Content.Shared/Chemistry/EntitySystems/SolutionSpikerSystem.cs index f179580604..468e28f65f 100644 --- a/Content.Shared/Chemistry/EntitySystems/SolutionSpikerSystem.cs +++ b/Content.Shared/Chemistry/EntitySystems/SolutionSpikerSystem.cs @@ -26,7 +26,8 @@ public sealed class SolutionSpikerSystem : EntitySystem private void OnInteractUsing(Entity entity, ref InteractUsingEvent args) { - TrySpike(args.Used, args.Target, args.User, entity.Comp); + if (TrySpike(args.Used, args.Target, args.User, entity.Comp)) + args.Handled = true; } /// @@ -36,7 +37,7 @@ public sealed class SolutionSpikerSystem : EntitySystem /// Source of the solution. /// Target to spike with the solution from source. /// User spiking the target solution. - private void TrySpike(EntityUid source, EntityUid target, EntityUid user, RefillableSolutionComponent? spikableTarget = null, + private bool TrySpike(EntityUid source, EntityUid target, EntityUid user, RefillableSolutionComponent? spikableTarget = null, SolutionSpikerComponent? spikableSource = null, SolutionContainerManagerComponent? managerSource = null, SolutionContainerManagerComponent? managerTarget = null) @@ -46,21 +47,23 @@ public sealed class SolutionSpikerSystem : EntitySystem || !_solution.TryGetRefillableSolution((target, spikableTarget, managerTarget), out var targetSoln, out var targetSolution) || !_solution.TryGetSolution((source, managerSource), spikableSource.SourceSolution, out _, out var sourceSolution)) { - return; + return false; } if (targetSolution.Volume == 0 && !spikableSource.IgnoreEmpty) { _popup.PopupClient(Loc.GetString(spikableSource.PopupEmpty, ("spiked-entity", target), ("spike-entity", source)), user, user); - return; + return false; } if (!_solution.ForceAddSolution(targetSoln.Value, sourceSolution)) - return; + return false; _popup.PopupClient(Loc.GetString(spikableSource.Popup, ("spiked-entity", target), ("spike-entity", source)), user, user); sourceSolution.RemoveAllSolution(); if (spikableSource.Delete) QueueDel(source); + + return true; } }