Compound stack sale moves only what the station holds (ruling no-market-absorption)
TrySellPart sells the units the station's bays take and pays for those alone; the rest stays in the seller's hold and the trade menu says how many sold. Simple goods keep their absorb path until the station-outflow cut. CommodityRecordsTests pins CompoundCommodityData's one key, MaxStack at 12. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
613ef9a185
commit
2a15c2f95c
4 changed files with 77 additions and 29 deletions
|
|
@ -296,6 +296,19 @@ public class TradeMenu : MonoBehaviour
|
|||
|
||||
private void Sell(ItemInstance item)
|
||||
{
|
||||
if (item is CompoundCommodity compound)
|
||||
{
|
||||
var offered = compound.Quantity;
|
||||
var sold = StationServices.TrySellPart(_targetCargo, GameManager.DockedEntity, compound, ref GameManager.Credits);
|
||||
UpdateCreditsLabel();
|
||||
Populate();
|
||||
if (sold == offered) return;
|
||||
Dialog.Clear();
|
||||
Dialog.Title.text = $"Sold {sold} of {offered}: Station Cargo Full!";
|
||||
Dialog.Show();
|
||||
Dialog.MoveToCursor();
|
||||
return;
|
||||
}
|
||||
if (StationServices.TrySell(_targetCargo, GameManager.DockedEntity, item, ref GameManager.Credits))
|
||||
{
|
||||
UpdateCreditsLabel();
|
||||
|
|
|
|||
Loading…
Reference in a new issue