265 {
266 HandEventForceSwap es = HandEventForceSwap.Cast(e);
267 if (es)
268 {
269 if (LogManager.IsInventoryHFSMLogEnable())
270 {
272 }
273
274 if (!es.m_Src2.IsValid() || !es.m_Src.IsValid())
275 {
276 Error(
"[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - invalid item source");
277 return false;
278 }
279
280 bool allow = e.m_IsJuncture || e.m_IsRemote;
281 if (allow == false)
282 {
283 if (GameInventory.CanSwapEntitiesEx(es.GetSrc().GetItem(), es.m_Src2.GetItem()))
284 {
285 allow = true;
286 }
287 else if (es.m_Dst2)
288 {
289 if (GameInventory.CanForceSwapEntitiesEx(es.GetSrc().GetItem(), es.m_Dst, es.m_Src2.GetItem(), es.m_Dst2) == false)
290 {
291 Error(
"[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - no room at dst=" + InventoryLocation.DumpToStringNullSafe(es.m_Dst2));
292 }
293 else
294 {
295 allow = true;
296 }
297 }
298 }
299
300 if (allow)
301 {
302 int animType1 = -1;
303 int animType2 = -1;
305 {
306 e.m_AnimationID = animType1;
308 return true;
309 }
310 }
311 else
312 {
313 Error(
"[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - m_HasRoomGuard.GuardCondition failed");
314 }
315 }
316 else
317 {
318 Error(
"[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - not a swap event");
319 }
320 return false;
321 }
void hndDebugPrint(string s)
override string DumpToString()
int m_Animation2ID
destination for old item that was in hands
bool ProcessSwapEvent(notnull HandEventBase e, out int animType1, out int animType2)
void Error(string err)
Messagebox with error message.