Fixes money being debitted multiple times (#4078)

This commit is contained in:
esguard
2021-05-30 07:19:14 +02:00
committed by GitHub
parent 5fad2123d9
commit 0ef61ba47a
3 changed files with 32 additions and 11 deletions

View File

@@ -133,9 +133,13 @@ namespace Content.Server.GameObjects.Components.Cargo
var capacity = _cargoConsoleSystem.GetCapacity(orders.Database.Id);
if (capacity.CurrentCapacity == capacity.MaxCapacity)
break;
if (!_cargoConsoleSystem.CheckBalance(_bankAccount.Id, (-product.PointCost) * order.Amount))
break;
if (!_cargoConsoleSystem.ApproveOrder(orders.Database.Id, msg.OrderNumber))
break;
if (!_cargoConsoleSystem.ChangeBalance(_bankAccount.Id, (-product.PointCost) * order.Amount))
break;
_cargoConsoleSystem.ApproveOrder(orders.Database.Id, msg.OrderNumber);
UpdateUIState();
break;
}