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

◆ HandleInventory()

void HandleInventory ( float dt)
protected

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

446 {
447 HumanCommandWeapons hcw = GetDayZPlayerOwner().GetCommandModifier_Weapons();
448
449 EntityAI ih = GetEntityInHands();
450 Weapon_Base weapon;
451 Class.CastTo(weapon, ih);
452
453 if (hcw)
454 {
455 m_FSM.GetCurrentState().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 ( !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
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 (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());
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=" + m_FSM.GetCurrentState());
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:2227
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:168
HandEventBase HandAnimEventFactory(WeaponEvents type, Man p=null, InventoryLocation src=null)
Определения Hand_Events.c:794
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
Определения Building.c:6
Abstracted event, not to be used, only inherited.
Определения Hand_Events.c:209
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:994
static bool IsInventoryHFSMLogEnable()
Определения Debug.c:668
Определения Debug.c:594
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:963
string WeaponActionTypeToString(int A, int AT)
Определения human.c:943

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