DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ TakeEntityAsTargetAttachmentEx()

bool GameInventory::TakeEntityAsTargetAttachmentEx ( InventoryMode mode,
notnull EntityAI target,
notnull EntityAI item,
int slot )
inlineprotected

put item as attachment of target

См. определение в файле 3_Game/DayZ/Systems/Inventory/Inventory.c строка 1100

1101 {
1102 if (LogManager.IsInventoryMoveLogEnable()) inventoryDebugPrint("[inv] I::Take2TargetAttEx(" + typename.EnumToString(InventoryMode, mode) + ") as ATT of target=" + target + " item=" + item + " slot=" + slot);
1103 InventoryLocation src = new InventoryLocation();
1104 if (item.GetInventory().GetCurrentInventoryLocation(src))
1105 {
1106 EntityAI att = target.GetInventory().FindAttachment(slot);
1107 if (att)
1108 {
1109 if (mode == InventoryMode.SERVER)
1110 {
1111 att.CombineItemsEx(item, true);
1112 }
1113 else
1114 {
1115 att.CombineItemsClient(item, true);
1116 }
1117 return true;
1118 }
1119 else if (item.CanBeSplit() && item.GetTargetQuantityMax(slot) < item.GetQuantity())
1120 {
1121 if (mode == InventoryMode.SERVER)
1122 {
1123 item.SplitIntoStackMaxEx(target, slot);
1124 }
1125 else
1126 {
1127 item.SplitIntoStackMaxClient(target,slot);
1128 }
1129 return true;
1130 }
1131 else
1132 {
1133 InventoryLocation dst = new InventoryLocation();
1134 dst.SetAttachment(target, item, slot);
1135 return TakeToDst(mode, src, dst);
1136 }
1137 }
1138 Error("[inv] I::Take2AttEx(" + typename.EnumToString(InventoryMode, mode) + ") item=" + item + " Error - src has no inventory location");
1139 return false;
1140 }
void inventoryDebugPrint(string s)
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
class LogManager EntityAI
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.
Определения EnDebug.c:90

Перекрестные ссылки Error(), inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), InventoryLocation::SetAttachment() и TakeToDst().

Используется в TakeEntityAsAttachmentEx().