private void HandleInventoriesAndOrder() { _sourceBuild = GetStructureSrcAndDestinyExpImp(); if (_sourceBuild == null) { return; } //need to pull left from Dispatch bz Order1 is passed by Value not Ref var left = WhatIsLeft(); var carryWeight = _person.HowMuchICanCarry() < left?_person.HowMuchICanCarry() : left; var amt = Order1.ApproveThisAmt(carryWeight); _person.ExchangeInvetoryItem(_sourceBuild, _person, Order1.Product, amt, _sourceBuild); //will add to processed order only if actually took something... if (_person.Inventory.ReturnAmtOfItemOnInv(Order1.Product) > 0 && _export) { var amtTaken = _person.Inventory.ReturnAmtOfItemOnInv(Order1.Product); //and will report actually only was he physically took from it _person.Work.Dispatch1.AddToOrderAmtProcessed(Order1, amtTaken); //Debug.Log(_person.MyId + " Docker got from:" + Order1.SourceBuild + " : " + Order1.Product + ".amt:" + amt); } else if (_import) { _person.Work.Dispatch1.AddToOrderAmtProcessed(Order1, amt); } _sourceBuild.CheckIfCanBeDestroyNow(Order1.Product); _person.Body.UpdatePersonalForWheelBa(); }
private void HandleInventoriesAndOrder() { //need to pull left from Dispatch bz Order1 is passed by Value not Ref var left = WhatIsLeft(); var amt = Order1.ApproveThisAmt(left); if (_person.Inventory.ReturnAmtOfItemOnInv(Order1.Product) > 0 && export()) { var amtTaken = _person.Inventory.ReturnAmtOfItemOnInv(Order1.Product); //and will report actually only was he physically took from it Dock().Dispatch1.AddToOrderAmtProcessed(Order1, amtTaken); } else if (import()) { Dock().Dispatch1.AddToOrderAmtProcessed(Order1, amt); } Dock().Dispatch1.CleanOrdersIfNeeded(); }