From 76712bfa136cf02f2aa9fa68a0363aaa27867b61 Mon Sep 17 00:00:00 2001 From: fishbait Date: Fri, 6 Dec 2024 22:04:11 +0100 Subject: [PATCH] [Fix] no more free chem change for bloba (#960) * no more free chem change for bloba ran into a bug where changing the chem type chud be done whitout paying for it. Now it checks and aborts if you dont have enuf points to do the change. * Update BlobObserverSystem.cs --------- Co-authored-by: Roudenn --- Content.Server/Backmen/Blob/BlobObserverSystem.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Content.Server/Backmen/Blob/BlobObserverSystem.cs b/Content.Server/Backmen/Blob/BlobObserverSystem.cs index 2dc417bd821..0051bef22a2 100644 --- a/Content.Server/Backmen/Blob/BlobObserverSystem.cs +++ b/Content.Server/Backmen/Blob/BlobObserverSystem.cs @@ -206,14 +206,15 @@ private void OnChemSelected(EntityUid uid, BlobObserverComponent component, Blob { if (component.Core == null || !TryComp(component.Core.Value, out var blobCoreComponent)) return; - + if (component.SelectedChemId == args.SelectedId) return; + + if (!_blobCoreSystem.TryUseAbility(component.Core.Value, blobCoreComponent.SwapChemCost)) + return; if (!ChangeChem(uid, args.SelectedId, component)) return; - - _blobCoreSystem.TryUseAbility(component.Core.Value, blobCoreComponent.SwapChemCost); } private bool ChangeChem(EntityUid uid, BlobChemType newChem, BlobObserverComponent component)