DayZ 1.29
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

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

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

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