SetPedState fixes

This commit is contained in:
Sergeanur 2020-12-15 03:25:05 +02:00
parent 0f5893ed60
commit ab3e258f19
6 changed files with 10 additions and 10 deletions

View file

@ -58,7 +58,7 @@ CPhoneInfo::Update(void)
} else { } else {
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_PHONE); CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_PHONE);
if (player->m_nPedState == PED_MAKE_CALL) if (player->m_nPedState == PED_MAKE_CALL)
player->m_nPedState = PED_IDLE; player->SetPedState(PED_IDLE);
} }
} }
bool notInCar; bool notInCar;
@ -105,7 +105,7 @@ CPhoneInfo::Update(void)
player->m_fRotationCur = angleToFace; player->m_fRotationCur = angleToFace;
player->m_fRotationDest = angleToFace; player->m_fRotationDest = angleToFace;
player->SetHeading(angleToFace); player->SetHeading(angleToFace);
player->m_nPedState = PED_MAKE_CALL; player->SetPedState(PED_MAKE_CALL);
CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_PHONE); CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_PHONE);
TheCamera.SetWideScreenOn(); TheCamera.SetWideScreenOn();
playerInfo->MakePlayerSafe(true); playerInfo->MakePlayerSafe(true);
@ -333,7 +333,7 @@ PhonePutDownCB(CAnimBlendAssociation *assoc, void *arg)
ped->bUpdateAnimHeading = true; ped->bUpdateAnimHeading = true;
if (ped->m_nPedState == PED_MAKE_CALL) if (ped->m_nPedState == PED_MAKE_CALL)
ped->m_nPedState = PED_IDLE; ped->SetPedState(PED_IDLE);
} }
void void

View file

@ -2125,7 +2125,7 @@ void CTheScripts::CleanUpThisPed(CPed* pPed)
if (pPed->m_nPedState == PED_FOLLOW_PATH && state != PED_FOLLOW_PATH) if (pPed->m_nPedState == PED_FOLLOW_PATH && state != PED_FOLLOW_PATH)
pPed->ClearFollowPath(); pPed->ClearFollowPath();
pPed->m_nPedState = state; pPed->SetPedState(state);
pPed->SetMoveState(ms); pPed->SetMoveState(ms);
} }
--CPopulation::ms_nTotalMissionPeds; --CPopulation::ms_nTotalMissionPeds;

View file

@ -314,7 +314,7 @@ CCivilianPed::ProcessControl(void)
for (int j = 0; j < m_numNearPeds; ++j) { for (int j = 0; j < m_numNearPeds; ++j) {
CPed *nearPed = m_nearPeds[j]; CPed *nearPed = m_nearPeds[j];
if (nearPed->m_nPedType == m_nPedType && nearPed->m_nPedState == PED_WANDER_PATH) { if (nearPed->m_nPedType == m_nPedType && nearPed->m_nPedState == PED_WANDER_PATH) {
nearPed->m_nPedState = PED_UNKNOWN; nearPed->SetPedState(PED_UNKNOWN);
} }
} }
} }

View file

@ -249,7 +249,7 @@ CCopPed::ArrestPlayer(void)
CPed *suspect = (CPed*)m_pSeekTarget; CPed *suspect = (CPed*)m_pSeekTarget;
if (suspect) { if (suspect) {
if (suspect->CanSetPedState()) if (suspect->CanSetPedState())
suspect->m_nPedState = PED_ARRESTED; SetPedState(PED_ARRESTED);
if (suspect->bInVehicle && m_pMyVehicle && suspect->m_pMyVehicle == m_pMyVehicle) { if (suspect->bInVehicle && m_pMyVehicle && suspect->m_pMyVehicle == m_pMyVehicle) {

View file

@ -7070,7 +7070,7 @@ CPed::SetEvasiveDive(CPhysical *reason, uint8 onlyRandomJump)
ClearLookFlag(); ClearLookFlag();
ClearAimFlag(); ClearAimFlag();
SetStoredState(); SetStoredState();
m_nPedState = PED_DIVE_AWAY; SetPedState(PED_DIVE_AWAY);
animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_EV_DIVE, 8.0f); animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_EV_DIVE, 8.0f);
animAssoc->SetFinishCallback(PedEvadeCB, this); animAssoc->SetFinishCallback(PedEvadeCB, this);
} }

View file

@ -5290,7 +5290,7 @@ CPed::SetEnterTrain(CVehicle *train, uint32 unused)
m_pMyVehicle = train; m_pMyVehicle = train;
m_pMyVehicle->RegisterReference((CEntity **) &m_pMyVehicle); m_pMyVehicle->RegisterReference((CEntity **) &m_pMyVehicle);
m_nPedState = PED_ENTER_TRAIN; SetPedState(PED_ENTER_TRAIN);
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_TRAIN_GETIN, 4.0f); m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_TRAIN_GETIN, 4.0f);
m_pVehicleAnim->SetFinishCallback(PedSetInTrainCB, this); m_pVehicleAnim->SetFinishCallback(PedSetInTrainCB, this);
bUsesCollision = false; bUsesCollision = false;
@ -5364,7 +5364,7 @@ CPed::SetExitTrain(CVehicle* train)
CVector exitPos; CVector exitPos;
GetNearestTrainPedPosition(train, exitPos); GetNearestTrainPedPosition(train, exitPos);
*/ */
m_nPedState = PED_EXIT_TRAIN; SetPedState(PED_EXIT_TRAIN);
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_TRAIN_GETOUT, 4.0f); m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_TRAIN_GETOUT, 4.0f);
m_pVehicleAnim->SetFinishCallback(PedSetOutTrainCB, this); m_pVehicleAnim->SetFinishCallback(PedSetOutTrainCB, this);
bUsesCollision = false; bUsesCollision = false;
@ -5390,7 +5390,7 @@ CPed::PedSetOutTrainCB(CAnimBlendAssociation *animAssoc, void *arg)
ped->bUsesCollision = true; ped->bUsesCollision = true;
ped->m_pVehicleAnim = nil; ped->m_pVehicleAnim = nil;
ped->bInVehicle = false; ped->bInVehicle = false;
ped->m_nPedState = PED_IDLE; ped->SetPedState(PED_IDLE);
ped->RestorePreviousObjective(); ped->RestorePreviousObjective();
ped->SetMoveState(PEDMOVE_STILL); ped->SetMoveState(PEDMOVE_STILL);