446 {
448
452
453 if (hcw)
454 {
455 m_FSM.GetCurrentState().OnUpdate(dt);
456
457 #ifdef ENABLE_LOGGING
459 {
461 }
462 #endif
463
464 if ( !m_FSM.GetCurrentState().IsIdle() || !m_FSM.IsRunning())
465 {
466 while (true)
467 {
468 int weaponEventId = hcw.
IsEvent();
469 if (weaponEventId == -1)
470 {
471 break;
472 }
473
475
476 #ifdef ENABLE_LOGGING
478 {
479 hndDebugPrint(
"[hndfsm] HandleInventory: event arrived " +
typename.EnumToString(
WeaponEvents, weaponEventId) +
"(" + weaponEventId +
") fsm_ev=" + anim_event.ToString());
480 }
481 #endif
482
483 if (anim_event != NULL)
484 {
486 ProcessHandEvent(anim_event);
487 }
488 }
489
491 {
492 if (m_FSM.GetCurrentState().IsWaitingForActionFinish())
493 {
494 #ifdef ENABLE_LOGGING
496 {
497 hndDebugPrint(
"[hndfsm] Hand-Weapon event: finished! notifying waiting state=" + m_FSM.GetCurrentState());
498 }
499 #endif
500
501 HandEventBase fin_event =
new HandEventHumanCommandActionFinished(GetManOwner());
503 ProcessHandEvent(fin_event);
504 }
505 else
506 {
507 #ifdef ENABLE_LOGGING
509 {
510 hndDebugPrint(
"[hndfsm] Hand-Weapon event: ABORT! notifying running state=" + m_FSM.GetCurrentState());
511 }
512 #endif
513
514 HandEventBase abt_event =
new HandEventHumanCommandActionAborted(GetManOwner());
516 ProcessHandAbortEvent(abt_event);
517
518 }
519 }
520 }
521 }
522 }
void SyncHandEventToRemote(HandEventBase e)
DayZPlayer GetDayZPlayerOwner()
HandEventBase HandAnimEventFactory(WeaponEvents type, Man p=null, InventoryLocation src=null)
void hndDebugSpamALot(string s)
void hndDebugPrint(string s)
Super root of all classes in Enforce script.
Abstracted event, not to be used, only inherited.
proto native bool IsActionFinished()
proto native int GetRunningAction()
returns -1 when no action is running or RELOAD,MECHANISM, ....
proto native int IsEvent()
return -1 when there is no event, otherwise it returns pId of event from animation
proto native int GetRunningActionType()
returns -1 when no action is running or appropriate action type
static bool IsInventoryHFSMLogEnable()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
string WeaponActionTypeToString(int A, int AT)