DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ HandleInventory()

void HandleInventory ( float dt)
protected

См. определение в файле DayZPlayerInventory.c строка 447

448 {
449 HumanCommandWeapons hcw = GetDayZPlayerOwner().GetCommandModifier_Weapons();
450
451 EntityAI ih = GetEntityInHands();
452 Weapon_Base weapon;
453 Class.CastTo(weapon, ih);
454
455 if (hcw)
456 {
457 HandStateBase fsmState = m_FSM.GetCurrentState();
458 fsmState.OnUpdate(dt);
459
460 #ifdef ENABLE_LOGGING
462 {
463 hndDebugSpamALot("[hndfsm] HCW: playing A=" + typename.EnumToString(WeaponActions, hcw.GetRunningAction()) + " AT=" + WeaponActionTypeToString(hcw.GetRunningAction(), hcw.GetRunningActionType()) + " fini=" + hcw.IsActionFinished());
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
477 HandEventBase anim_event = HandAnimEventFactory(weaponEventId, GetManOwner(), NULL);
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 {
488 SyncHandEventToRemote(anim_event);
489 ProcessHandEvent(anim_event);
490 }
491 }
492
493 if (hcw.IsActionFinished())
494 {
495 if (fsmState.IsWaitingForActionFinish())
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());
505 SyncHandEventToRemote(fin_event);
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());
518 SyncHandEventToRemote(abt_event);
519 ProcessHandAbortEvent(abt_event);
520 //m_FSM.ProcessHandAbortEvent(new WeaponEventHumanCommandActionAborted(GetManOwner()));
521 }
522 }
523 }
524 }
525 }
void SyncHandEventToRemote(HandEventBase e)
Определения DayZPlayerInventory.c:4372
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:170
HandEventBase HandAnimEventFactory(WeaponEvents type, Man p=null, InventoryLocation src=null)
Определения Hand_Events.c:853
void hndDebugSpamALot(string s)
Определения HandFSM.c:17
void hndDebugPrint(string s)
Определения HandFSM.c:1
Super root of all classes in Enforce script.
Определения EnScript.c:11
Abstracted event, not to be used, only inherited.
Определения Hand_Events.c:212
override bool IsIdle()
idle state does not expect any animation events
Определения HandStableState.c:34
override void OnUpdate(float dt)
Определения HandStableState.c:19
override bool IsWaitingForActionFinish()
waiting for active animation action/actionType finish
Определения HandAnimatedForceSwapping.c:73
represent hand state base
Определения HandAnimatedForceSwapping.c:4
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
Определения human.c:1027
static bool IsInventoryHFSMLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:779
shorthand
Определения BoltActionRifle_Base.c:6
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
WeaponActions
actions
Определения human.c:843
WeaponEvents
events
Определения human.c:996
string WeaponActionTypeToString(int A, int AT)
Определения human.c:976

Перекрестные ссылки Class::CastTo(), GetDayZPlayerOwner(), HumanCommandWeapons::GetRunningAction(), HumanCommandWeapons::GetRunningActionType(), HandAnimEventFactory(), hndDebugPrint(), hndDebugSpamALot(), HumanCommandWeapons::IsActionFinished(), HumanCommandWeapons::IsEvent(), HandStateBase::IsIdle(), LogManager::IsInventoryHFSMLogEnable(), HandStateBase::IsWaitingForActionFinish(), HandStateBase::OnUpdate(), SyncHandEventToRemote() и WeaponActionTypeToString().