3039 {
3042 if (!swapValidation)
3043 {
3044 return false;
3045 }
3046
3047#ifdef ENABLE_LOGGING
3049 {
3051 }
3052#endif
3053
3056
3058 {
3060 return true;
3061 }
3062
3063 bool hasJuncture = false;
3064 int nonNullCount = 0;
3065 bool failed = false;
3066
3068 {
3069 nonNullCount++;
3071 {
3072 failed = true;
3073 }
3074 }
3075
3076 if (!failed && swapValidation.
m_SrcItem2 != null)
3077 {
3078 nonNullCount++;
3080 {
3081 failed = true;
3082 }
3083 }
3084
3085 if (!failed && swapValidation.
m_DstItem1 != null)
3086 {
3087 nonNullCount++;
3089 {
3090 failed = true;
3091 }
3092 }
3093
3094 if (!failed && swapValidation.
m_DstItem2 != null)
3095 {
3096 nonNullCount++;
3098 {
3099 failed = true;
3100 }
3101 }
3102
3103 hasJuncture = (nonNullCount > 0 && !failed);
3104
3105 if (!hasJuncture)
3106 {
3107#ifdef ENABLE_LOGGING
3109 {
3111 }
3112#endif
3114 }
3115
3118
3119
3121 {
3122#ifdef ENABLE_LOGGING
3124 {
3125 Debug.
InventoryMoveLog(
"Failed - !SwapCheckExclusionMaskLocal - condition failed locally",
"SWAP" ,
"n/a",
"ExecuteSwapCommandServer", playerOwner.ToString() );
3126 }
3127#endif
3128 return false;
3129 }
3130
3132 {
3133#ifdef ENABLE_LOGGING
3135 {
3136 Debug.
InventoryMoveLog(
"Failed - !CanForceSwapEntitiesEx",
"SWAP" ,
"n/a",
"ExecuteSwapCommandServer", playerOwner.ToString() );
3137 }
3138#endif
3139 return false;
3140 }
3141
3142#ifdef ENABLE_LOGGING
3144 {
3145 Debug.
InventoryMoveLog(
"Success - item swap",
"SWAP" ,
"n/a",
"ExecuteSwapCommandServer", playerOwner.ToString() );
3146 }
3147#endif
3148
3150 {
3151 bool isNotSkipped = LocationSwap(swapValidation.
m_Src1, swapValidation.
m_Src2, swapValidation.
m_Dst1, swapValidation.
m_Dst2);
3154 return true;
3155 }
3156
3157 return false;
3158 }
bool SwapCheckExclusionMaskLocal(notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
Local, checks only stuff that is in guaranteed sync.
void RemoveMovableOverride(EntityAI item)
DayZPlayer GetDayZPlayerOwner()
static void InventoryMoveLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
script counterpart to engine's class Inventory
ref InventoryLocation m_Src2
ref InventoryLocation m_Src1
ref InventoryLocation m_Dst1
ref InventoryLocation m_Dst2
proto native bool IsValid()
verify current set inventory location
static string DumpToStringNullSafe(InventoryLocation loc)
static bool IsInventoryMoveLogEnable()
void Error(string err)
Messagebox with error message.