1136 {
1137 if (LogManager.IsInventoryMoveLogEnable())
inventoryDebugPrint(
"[inv] I::Take2TargetAttEx(" +
typename.EnumToString(
InventoryMode, mode) +
") as ATT of target=" + target +
" item=" + item +
" slot=" + slot);
1138 InventoryLocation src = new InventoryLocation();
1139 if (item.GetInventory().GetCurrentInventoryLocation(src))
1140 {
1141 EntityAI att = target.GetInventory().FindAttachment(slot);
1142 if (att)
1143 {
1145 {
1146 att.CombineItemsEx(item, true);
1147 }
1148 else
1149 {
1150 att.CombineItemsClient(item, true);
1151 }
1152 return true;
1153 }
1154 else if (item.CanBeSplit() && item.GetTargetQuantityMax(slot) < item.GetQuantity())
1155 {
1157 {
1158 item.SplitIntoStackMaxEx(target, slot);
1159 }
1160 else
1161 {
1162 item.SplitIntoStackMaxClient(target,slot);
1163 }
1164 return true;
1165 }
1166 else
1167 {
1168 InventoryLocation dst = new InventoryLocation();
1171 }
1172 }
1173 Error(
"[inv] I::Take2AttEx(" +
typename.EnumToString(
InventoryMode, mode) +
") item=" + item +
" Error - src has no inventory location");
1174 return false;
1175 }
void inventoryDebugPrint(string s)
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
move src to dst
proto native void SetAttachment(notnull EntityAI parent, EntityAI e, int slotId)
sets current inventory location type to Attachment with slot id set to <slotId>
void Error(string err)
Messagebox with error message.