DayZ 1.30
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 строка 650

651 {
652 if (pCurrentCommandID == DayZPlayerConstants.COMMANDID_DEATH)
653 {
655 {
656 case -1:
657 break;
658 case 0:
660
661 PhysicsSetSolid(true);
662
664 DayZPlayerVehicleCommandDeathCallback callbackVeh;
665 Class.CastTo(callbackVeh, StartCommand_Death(DayZPlayerConstants.DEATH_PULL_OUT_TRANSPORT, 0, DayZPlayerVehicleCommandDeathCallback, m_PullPlayerOutOfVehicleKeepsInLocalSpace));
666 Class.CastTo(callbackVeh.m_pPlayer, this);
667 break;
668 }
669
670 return true;
671 }
672
673 if (m_DeathAnimType != -2 && g_Game.GetMissionState() == g_Game.MISSION_STATE_GAME)
674 {
675 if (!CommitedSuicide())
676 {
677 int type = m_DeathAnimType;
678 if (type == DayZPlayerConstants.DEATH_DEFAULT)
679 type = GetTypeOfDeath(pCurrentCommandID);
680
681 m_WasInVehicle = false;
682 HumanCommandVehicle hcv = GetCommand_Vehicle();
683 if (hcv)
684 {
686 m_WasInVehicle = !hcv.IsGettingIn() && !hcv.IsGettingOut();
687 }
688
689 int seatIndex = -1;
691 {
692 seatIndex = m_TransportCache.CrewMemberIndex(this);
693 }
694
696 m_ShouldBeUnconscious = false;
697
698 bool keepInLocalSpace = m_PullPlayerOutOfVehicleKeepsInLocalSpace;
700 {
701 if (IsUnconscious() || m_WasInVehicle)
702 {
703 keepInLocalSpace = true;
704 m_TransportCache.CrewDeath(seatIndex);
705 }
706 else
707 {
708 m_TransportCache.CrewGetOut(seatIndex);
709 }
710
711 m_TransportCache.MarkCrewMemberDead(seatIndex);
712
713 if (seatIndex == DayZPlayerConstants.VEHICLESEAT_DRIVER)
714 {
716
717#ifdef FEATURE_NETWORK_RECONCILIATION
718 PlayerIdentity identity = GetIdentity();
719
720 if (identity)
721 {
723 identity.Possess(this);
724 }
725#endif
726 }
727
728 Motorbike motorbike = Motorbike.Cast(m_TransportCache);
729 if (motorbike)
730 {
731 motorbike.FallOver();
732 }
733 }
734
735 DisableSimulation(false);
736 GetItemAccessor().HideItemInHands(false);
737 m_TransportCache = null;
738
739 DayZPlayerCommandDeathCallback callback;
740 Class.CastTo(callback, StartCommand_Death(type, m_DeathHitDir, DayZPlayerCommandDeathCallback, keepInLocalSpace));
741 Class.CastTo(callback.m_pPlayer, this);
742 }
743 else
744 {
745 PhysicsSetSimpleDeath(true);
746 }
747
748 // disable voice communication
749 g_Game.GetWorld().SetVoiceOn(false, false);
750
751 return true;
752 }
753
754 return false;
755 }
DayZGame g_Game
Определения DayZGame.c:4074
bool m_ShouldBeUnconscious
Определения DayZPlayerImplement.c:125
bool CommitedSuicide()
Определения DayZPlayerImplement.c:3945
int m_DeathAnimType
Определения DayZPlayerImplement.c:504
int m_PullPlayerOutOfVehicleState
Определения DayZPlayerImplement.c:162
bool m_PullPlayerOutOfVehicleKeepsInLocalSpace
Определения DayZPlayerImplement.c:161
bool m_WasInVehicle
Определения DayZPlayerImplement.c:159
int GetTypeOfDeath(int pCurrentCommandID)
Определения DayZPlayerImplement.c:762
float m_DeathHitDir
Определения DayZPlayerImplement.c:505
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().