448 {
450
454
455 if (hcw)
456 {
459
460 #ifdef ENABLE_LOGGING
462 {
464 }
465 #endif
466
467 if ( !fsmState.
IsIdle() || !m_FSM.IsRunning())
468 {
469 while (true)
470 {
471 int weaponEventId = hcw.
IsEvent();
472 if (weaponEventId == -1)
473 {
474 break;
475 }
476
478
479 #ifdef ENABLE_LOGGING
481 {
482 hndDebugPrint(
"[hndfsm] HandleInventory: event arrived " +
typename.EnumToString(
WeaponEvents, weaponEventId) +
"(" + weaponEventId +
") fsm_ev=" + anim_event.ToString());
483 }
484 #endif
485
486 if (anim_event != NULL)
487 {
489 ProcessHandEvent(anim_event);
490 }
491 }
492
494 {
496 {
497 #ifdef ENABLE_LOGGING
499 {
500 hndDebugPrint(
"[hndfsm] Hand-Weapon event: finished! notifying waiting state=" + fsmState);
501 }
502 #endif
503
504 HandEventBase fin_event =
new HandEventHumanCommandActionFinished(GetManOwner());
506 ProcessHandEvent(fin_event);
507 }
508 else
509 {
510 #ifdef ENABLE_LOGGING
512 {
513 hndDebugPrint(
"[hndfsm] Hand-Weapon event: ABORT! notifying running state=" + fsmState);
514 }
515 #endif
516
517 HandEventBase abt_event =
new HandEventHumanCommandActionAborted(GetManOwner());
519 ProcessHandAbortEvent(abt_event);
520
521 }
522 }
523 }
524 }
525 }
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.
override bool IsIdle()
idle state does not expect any animation events
override void OnUpdate(float dt)
override bool IsWaitingForActionFinish()
waiting for active animation action/actionType finish
represent hand state base
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)