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

◆ MakeSrcAndDstForForceSwap()

static bool GameInventory::MakeSrcAndDstForForceSwap ( notnull EntityAI item1,
notnull EntityAI item2,
out InventoryLocation src1,
out InventoryLocation src2,
out InventoryLocation dst1,
notnull InventoryLocation dst2 )
inlinestaticprotected

helper function for ForceSwap

См. определение в файле Inventory.c строка 1221

1222 {
1223 if (src1 == null)
1224 src1 = new InventoryLocation();
1225 if (src2 == null)
1226 src2 = new InventoryLocation();
1227
1228 if (item1.GetInventory().GetCurrentInventoryLocation(src1) && item2.GetInventory().GetCurrentInventoryLocation(src2))
1229 {
1230 // src1 -> dst_of(src2)
1231 if (dst1 == null)
1232 dst1 = new InventoryLocation();
1233
1234 dst1.Copy(src1);
1235 dst1.CopyLocationFrom(src2, false);
1236 dst1.SetFlip(dst1.GetItem().GetInventory().GetFlipCargo());
1237
1238 // src2 -> dst2 from user
1239 return true;
1240 }
1241
1242 return false;
1243 }

Используется в ForceSwapEntities() и HumanInventory::ForceSwapEntities().