Skip to content

Commit

Permalink
[Fix] no more free chem change for bloba (#960)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
jorgun and Roudenn authored Dec 6, 2024
1 parent f83b5a3 commit 76712bf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Content.Server/Backmen/Blob/BlobObserverSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,15 @@ private void OnChemSelected(EntityUid uid, BlobObserverComponent component, Blob
{
if (component.Core == null || !TryComp<BlobCoreComponent>(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)
Expand Down

0 comments on commit 76712bf

Please sign in to comment.