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

◆ HandleInventory()

void HandleInventory ( float dt)
protected

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

445 {
446 HumanCommandWeapons hcw = GetDayZPlayerOwner().GetCommandModifier_Weapons();
447
448 EntityAI ih = GetEntityInHands();
449 Weapon_Base weapon;
450 Class.CastTo(weapon, ih);
451
452 if (hcw)
453 {
454 HandStateBase fsmState = m_FSM.GetCurrentState();
455 fsmState.OnUpdate(dt);
456
457 #ifdef ENABLE_LOGGING
459 {
460 hndDebugSpamALot("[hndfsm] HCW: playing A=" + typename.EnumToString(WeaponActions, hcw.GetRunningAction()) + " AT=" + WeaponActionTypeToString(hcw.GetRunningAction(), hcw.GetRunningActionType()) + " fini=" + hcw.IsActionFinished());
461 }
462 #endif
463
464 if ( !fsmState.IsIdle() || !m_FSM.IsRunning())
465 {
466 while (true)
467 {
468 int weaponEventId = hcw.IsEvent();
469 if (weaponEventId == -1)
470 {
471 break;
472 }
473
474 HandEventBase anim_event = HandAnimEventFactory(weaponEventId, GetManOwner(), NULL);
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 {
485 SyncHandEventToRemote(anim_event);
486 ProcessHandEvent(anim_event);
487 }
488 }
489
490 if (hcw.IsActionFinished())
491 {
492 if (fsmState.IsWaitingForActionFinish())
493 {
494 #ifdef ENABLE_LOGGING
496 {
497 hndDebugPrint("[hndfsm] Hand-Weapon event: finished! notifying waiting state=" + fsmState);
498 }
499 #endif
500
501 HandEventBase fin_event = new HandEventHumanCommandActionFinished(GetManOwner());
502 SyncHandEventToRemote(fin_event);
503 ProcessHandEvent(fin_event);
504 }
505 else
506 {
507 #ifdef ENABLE_LOGGING
509 {
510 hndDebugPrint("[hndfsm] Hand-Weapon event: ABORT! notifying running state=" + fsmState);
511 }
512 #endif
513
514 HandEventBase abt_event = new HandEventHumanCommandActionAborted(GetManOwner());
515 SyncHandEventToRemote(abt_event);
516 ProcessHandAbortEvent(abt_event);
517 //m_FSM.ProcessHandAbortEvent(new WeaponEventHumanCommandActionAborted(GetManOwner()));
518 }
519 }
520 }
521 }
522 }
void SyncHandEventToRemote(HandEventBase e)
Определения DayZPlayerInventory.c:2542
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:167
HandEventBase HandAnimEventFactory(WeaponEvents type, Man p=null, InventoryLocation src=null)
Определения Hand_Events.c:847
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:1000
static bool IsInventoryHFSMLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:766
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:816
WeaponEvents
events
Определения human.c:969
string WeaponActionTypeToString(int A, int AT)
Определения human.c:949

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