Cargo: pizza & bureaucracy (#5123)
* add paper label component * git mv * rename namespace * add cargo printouts * more crates * directly attach paper * comment typo
This commit is contained in:
@@ -135,6 +135,10 @@ namespace Content.Server.Cargo.Components
|
||||
break;
|
||||
}
|
||||
|
||||
var uid = msg.Session.AttachedEntityUid;
|
||||
if (uid == null)
|
||||
break;
|
||||
|
||||
PrototypeManager.TryIndex(order.ProductId, out CargoProductPrototype? product);
|
||||
if (product == null!)
|
||||
break;
|
||||
@@ -143,13 +147,14 @@ namespace Content.Server.Cargo.Components
|
||||
(capacity.CurrentCapacity == capacity.MaxCapacity
|
||||
|| capacity.CurrentCapacity + order.Amount > capacity.MaxCapacity
|
||||
|| !_cargoConsoleSystem.CheckBalance(_bankAccount.Id, (-product.PointCost) * order.Amount)
|
||||
|| !_cargoConsoleSystem.ApproveOrder(orders.Database.Id, msg.OrderNumber)
|
||||
|| !_cargoConsoleSystem.ApproveOrder(Owner.Uid, uid.Value, orders.Database.Id, msg.OrderNumber)
|
||||
|| !_cargoConsoleSystem.ChangeBalance(_bankAccount.Id, (-product.PointCost) * order.Amount))
|
||||
)
|
||||
{
|
||||
SoundSystem.Play(Filter.Local(), _errorSound.GetSound(), Owner, AudioParams.Default);
|
||||
break;
|
||||
}
|
||||
|
||||
UpdateUIState();
|
||||
break;
|
||||
}
|
||||
@@ -189,12 +194,7 @@ namespace Content.Server.Cargo.Components
|
||||
orders.Database.ClearOrderCapacity();
|
||||
foreach (var order in approvedOrders)
|
||||
{
|
||||
if (!PrototypeManager.TryIndex(order.ProductId, out CargoProductPrototype? product))
|
||||
continue;
|
||||
for (var i = 0; i < order.Amount; i++)
|
||||
{
|
||||
telepadComponent.QueueTeleport(product);
|
||||
}
|
||||
telepadComponent.QueueTeleport(order);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user