2288 {
2290 if (deferred_force_swap_entities)
2291 {
2292 deferred_force_swap_entities.ClearInventoryReservation(this);
2295 deferred_force_swap_entities.m_item1.GetInventory().GetCurrentInventoryLocation(src1);
2296 deferred_force_swap_entities.m_item2.GetInventory().GetCurrentInventoryLocation(src2);
2297
2299
2301 {
2303 }
2304
2305 switch (deferred_force_swap_entities.m_mode)
2306 {
2308 if (CanForceSwapEntitiesEx(deferred_force_swap_entities.m_dst1.GetItem(),deferred_force_swap_entities.m_dst1,deferred_force_swap_entities.m_dst2.GetItem(), deferred_force_swap_entities.m_dst2))
2309 {
2310 #ifdef DIAG_DEVELOPER
2311 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
2312 {
2313 LocationSwap(src1, src2, deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2);
2314 }
2315 else
2316 {
2317 #endif
2319 LocationSwap(src1, src2, deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2);
2320 #ifdef DIAG_DEVELOPER
2321 }
2322 #endif
2323 }
2324 else
2325 {
2326 #ifdef ENABLE_LOGGING
2328 {
2330 }
2331 #endif
2332 }
2333 break;
2334
2336 if (CanForceSwapEntitiesEx(deferred_force_swap_entities.m_dst1.GetItem(), deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2.GetItem(), deferred_force_swap_entities.m_dst2))
2337 {
2338 #ifdef DIAG_DEVELOPER
2339 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
2340 {
2341 LocationSwap(src1, src2, deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2);
2342 }
2343 else
2344 {
2345 #endif
2346
2347
2350
2352 #ifdef DIAG_DEVELOPER
2353 }
2354 #endif
2355 }
2356 else
2357 {
2358 #ifdef ENABLE_LOGGING
2360 {
2362 }
2363 #endif
2364 }
2365 break;
2366
2368 break;
2369
2370 default:
2371 Error(
"ForceSwapEntities - HandEvent - Invalid mode");
2372 }
2373 }
2374 }
void inventoryDebugPrint(string s)
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
void DeferredForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
DayZPlayer GetDayZPlayerOwner()
PluginBase GetPlugin(typename plugin_type)
static void InventoryMoveLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
const int c_InventoryReservationTimeoutShortMS
script counterpart to engine's class Inventory
static string DumpToStringNullSafe(InventoryLocation loc)
static bool IsInventoryMoveLogEnable()
void Error(string err)
Messagebox with error message.