Put item anywhere into this entity (as attachment or into cargo, recursively)
- Аргументы
-
| [in] | mode | inventory mode |
| [in] | flags | preferred location, |
- См. также
- FindInventoryLocationType
- Аргументы
-
| [in] | item | item to be taken in inventory |
- Возвращает
- true on success
@NOTE: Predictive.* / Local.* functions: a) 'Predictive' means that the operation uses Client-Side Prediction, i.e. the action runs the same code on both, client AND server.
b) 'Local' operation executes from where it is run, i.e. the operation from client is NOT sent to server, and only client performs the inventory operation (TakeEntityTo.*) this behaviour is necessary when inventory operations are ALREADY synchronized by another means, like Actions. For example
- См. также
- ActionTakeItemToHands that performs OnCompleteServer and OnCompleteClient with synchronization set to false in order to avoid duplicate synchronization.
См. определение в файле 3_Game/DayZ/Systems/Inventory/Inventory.c строка 1013
1014 {
1016
1017 InventoryLocation src = new InventoryLocation();
1018 if (item.GetInventory().GetCurrentInventoryLocation(src))
1019 {
1020 InventoryLocation dst = new InventoryLocation();
1023
1024 if (LogManager.IsInventoryMoveLogEnable())
inventoryDebugPrint(
"[inv] I::Take2Inv(" +
typename.EnumToString(
InventoryMode, mode) +
") item=" + item +
" Warning - no room for item");
1025 return false;
1026 }
1027 Error(
"[inv] I::Take2Inv(" +
typename.EnumToString(
InventoryMode, mode) +
") item=" + item +
" Error - src has no inventory location");
1028 return false;
1029 }
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 bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.
void Error(string err)
Messagebox with error message.
Перекрестные ссылки Error(), FindFreeLocationFor(), inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable() и TakeToDst().
Используется в TakeEntityAsAttachment() и TakeEntityToCargo().