Skip to content

Commit

Permalink
Reimplement pallet selling
Browse files Browse the repository at this point in the history
  • Loading branch information
DebugOk committed Sep 29, 2023
1 parent 25fde71 commit 0fdb2a3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,16 @@ private void OnPalletSale(EntityUid uid, CargoPalletConsoleComponent component,
return;
}

SellPallets(gridUid, null, out var price);
var stackPrototype = _protoMan.Index<StackPrototype>(component.CashType);
_stack.Spawn((int) price, stackPrototype, uid.ToCoordinates());
// Delta-V change, on sale, add cash to the stations bank account instead of throwing it on the floor
var stationUid = _station.GetOwningStation(uid);

if (TryComp<StationBankAccountComponent>(stationUid, out var bank))
{
SellPallets(gridUid, null, out var amount);
bank.Balance += (int) amount;
}
// End of Delta-V change

UpdatePalletConsoleInterface(uid);
}

Expand Down

0 comments on commit 0fdb2a3

Please sign in to comment.