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

◆ HandleDeath()

bool DayZPlayer::HandleDeath ( int pCurrentCommandID)
inlineprotected

Can't pull a body out of a car that is in water, don't need to handle that

player looks to be dead now, not unconscious

we don't want the vehicle to be haunted, re-possess the dead player so other players can use the vehicle

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

648 {
649 if (pCurrentCommandID == DayZPlayerConstants.COMMANDID_DEATH)
650 {
652 {
653 case -1:
654 break;
655 case 0:
657
658 PhysicsSetSolid(true);
659
661 DayZPlayerVehicleCommandDeathCallback callbackVeh;
662 Class.CastTo(callbackVeh, StartCommand_Death(DayZPlayerConstants.DEATH_PULL_OUT_TRANSPORT, 0, DayZPlayerVehicleCommandDeathCallback, m_PullPlayerOutOfVehicleKeepsInLocalSpace));
663 Class.CastTo(callbackVeh.m_pPlayer, this);
664 break;
665 }
666
667 return true;
668 }
669
670 if (m_DeathAnimType != -2 && g_Game.GetMissionState() == g_Game.MISSION_STATE_GAME)
671 {
672 if (!CommitedSuicide())
673 {
674 int type = m_DeathAnimType;
675 if (type == DayZPlayerConstants.DEATH_DEFAULT)
676 type = GetTypeOfDeath(pCurrentCommandID);
677
678 m_WasInVehicle = false;
679 HumanCommandVehicle hcv = GetCommand_Vehicle();
680 if (hcv)
681 {
683 m_WasInVehicle = !hcv.IsGettingIn() && !hcv.IsGettingOut();
684 }
685
686 int seatIndex = -1;
688 {
689 seatIndex = m_TransportCache.CrewMemberIndex(this);
690 }
691
693 m_ShouldBeUnconscious = false;
694
695 bool keepInLocalSpace = m_PullPlayerOutOfVehicleKeepsInLocalSpace;
697 {
698 if (IsUnconscious() || m_WasInVehicle)
699 {
700 keepInLocalSpace = true;
701 m_TransportCache.CrewDeath(seatIndex);
702 }
703 else
704 {
705 m_TransportCache.CrewGetOut(seatIndex);
706 }
707
708 m_TransportCache.MarkCrewMemberDead(seatIndex);
709
710 if (seatIndex == DayZPlayerConstants.VEHICLESEAT_DRIVER)
711 {
713
714#ifdef FEATURE_NETWORK_RECONCILIATION
715 PlayerIdentity identity = GetIdentity();
716
717 if (identity)
718 {
720 identity.Possess(this);
721 }
722#endif
723 }
724 }
725
726 DisableSimulation(false);
727 GetItemAccessor().HideItemInHands(false);
728 m_TransportCache = null;
729
730 DayZPlayerCommandDeathCallback callback;
731 Class.CastTo(callback, StartCommand_Death(type, m_DeathHitDir, DayZPlayerCommandDeathCallback, keepInLocalSpace));
732 Class.CastTo(callback.m_pPlayer, this);
733 }
734 else
735 {
736 PhysicsSetRagdoll(true);
737 }
738
739 // disable voice communication
740 g_Game.GetWorld().SetVoiceOn(false, false);
741
742 return true;
743 }
744
745 return false;
746 }
DayZGame g_Game
Определения DayZGame.c:3942
bool m_ShouldBeUnconscious
Определения DayZPlayerImplement.c:125
bool CommitedSuicide()
Определения DayZPlayerImplement.c:3801
int m_DeathAnimType
Определения DayZPlayerImplement.c:501
int m_PullPlayerOutOfVehicleState
Определения DayZPlayerImplement.c:161
bool m_PullPlayerOutOfVehicleKeepsInLocalSpace
Определения DayZPlayerImplement.c:160
bool m_WasInVehicle
Определения DayZPlayerImplement.c:158
int GetTypeOfDeath(int pCurrentCommandID)
Определения DayZPlayerImplement.c:753
float m_DeathHitDir
Определения DayZPlayerImplement.c:502
Transport m_TransportCache
Определения DayZPlayerImplement.c:140
proto native Transport GetTransport()
proto native bool IsGettingIn()
proto native bool IsGettingOut()
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602

Перекрестные ссылки Class::CastTo(), CommitedSuicide(), g_Game, HumanCommandVehicle::GetTransport(), GetTypeOfDeath(), HumanCommandVehicle::IsGettingIn(), HumanCommandVehicle::IsGettingOut(), m_DeathAnimType, m_DeathHitDir, DayZPlayerCommandDeathCallback::m_pPlayer, m_PullPlayerOutOfVehicleKeepsInLocalSpace, m_PullPlayerOutOfVehicleState, m_ShouldBeUnconscious, m_TransportCache и m_WasInVehicle.

Используется в CommandHandler().