4118 {
4120 if (deferred_force_swap_entities)
4121 {
4122 deferred_force_swap_entities.ClearInventoryReservation(this);
4125 deferred_force_swap_entities.m_item1.GetInventory().GetCurrentInventoryLocation(src1);
4126 deferred_force_swap_entities.m_item2.GetInventory().GetCurrentInventoryLocation(src2);
4127
4129
4131 {
4133 }
4134
4135 switch (deferred_force_swap_entities.m_mode)
4136 {
4138 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))
4139 {
4140 #ifdef DIAG_DEVELOPER
4141 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
4142 {
4143 LocationSwap(src1, src2, deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2);
4144 }
4145 else
4146 {
4147 #endif
4149 LocationSwap(src1, src2, deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2);
4150 #ifdef DIAG_DEVELOPER
4151 }
4152 #endif
4153 }
4154 else
4155 {
4156 #ifdef ENABLE_LOGGING
4158 {
4160 }
4161 #endif
4162 }
4163 break;
4164
4166 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))
4167 {
4168 #ifdef DIAG_DEVELOPER
4169 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsLocalOnlyMoveEnable())
4170 {
4171 LocationSwap(src1, src2, deferred_force_swap_entities.m_dst1, deferred_force_swap_entities.m_dst2);
4172 }
4173 else
4174 {
4175 #endif
4176
4177
4180
4182 #ifdef DIAG_DEVELOPER
4183 }
4184 #endif
4185 }
4186 else
4187 {
4188 #ifdef ENABLE_LOGGING
4190 {
4192 }
4193 #endif
4194 }
4195 break;
4196
4198 break;
4199
4200 default:
4201 Error(
"ForceSwapEntities - HandEvent - Invalid mode");
4202 }
4203 }
4204 }
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.