* Fix merge conflicts with #4078 Check if the requested cargo order amount exceeds the maximum capacity Check if the maximum order capacity would be exceeded given current capcity and order amount when approved Cap maximum cargo request amount on client-side Play an error sound if a cargo order could not be added or approved * Add back error sound * Cargo orders over the maximum amount do not close the order UI
This commit is contained in:
@@ -151,8 +151,11 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
|
||||
public bool AddOrder(int id, string requester, string reason, string productId, int amount, int payingAccountId)
|
||||
{
|
||||
if (amount < 1 || !TryGetOrderDatabase(id, out var database))
|
||||
if (amount < 1 || !TryGetOrderDatabase(id, out var database) || amount > database.MaxOrderSize)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
database.AddOrder(requester, reason, productId, amount, payingAccountId);
|
||||
SyncComponentsWithId(id);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user