DayZ 1.30
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 строка 1180

1181 {
1182 if (src1 == null)
1183 src1 = new InventoryLocation();
1184 if (src2 == null)
1185 src2 = new InventoryLocation();
1186
1187 if (item1.GetInventory().GetCurrentInventoryLocation(src1) && item2.GetInventory().GetCurrentInventoryLocation(src2))
1188 {
1189 // src1 -> dst_of(src2)
1190 if (dst1 == null)
1191 dst1 = new InventoryLocation();
1192
1193 dst1.Copy(src1);
1194 dst1.CopyLocationFrom(src2, false);
1195 dst1.SetFlip(dst1.GetItem().GetInventory().GetFlipCargo());
1196
1197 // src2 -> dst2 from user
1198 return true;
1199 }
1200
1201 return false;
1202 }

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