mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-12-23 16:21:50 +01:00
rename m_vehEnterType -> m_vehDoor
This commit is contained in:
parent
4741afd2cf
commit
e3a261d29c
@ -792,20 +792,20 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
|
||||
}else{
|
||||
pPed->m_pMyVehicle->RemovePassenger(pPed);
|
||||
}
|
||||
if (pPed->m_vehEnterType) {
|
||||
if (pPed->m_vehDoor) {
|
||||
if (pPed->GetPedState() == PED_EXIT_CAR || pPed->GetPedState() == PED_DRAG_FROM_CAR) {
|
||||
uint8 flags = 0;
|
||||
if (pPed->m_pMyVehicle->IsBike()) {
|
||||
if (pPed->m_vehEnterType == CAR_DOOR_LF ||
|
||||
pPed->m_vehEnterType == CAR_DOOR_RF ||
|
||||
pPed->m_vehEnterType == CAR_WINDSCREEN)
|
||||
if (pPed->m_vehDoor == CAR_DOOR_LF ||
|
||||
pPed->m_vehDoor == CAR_DOOR_RF ||
|
||||
pPed->m_vehDoor == CAR_WINDSCREEN)
|
||||
flags = CAR_DOOR_FLAG_LF | CAR_DOOR_FLAG_RF;
|
||||
else if (pPed->m_vehEnterType == CAR_DOOR_LR ||
|
||||
pPed->m_vehEnterType == CAR_DOOR_RR)
|
||||
else if (pPed->m_vehDoor == CAR_DOOR_LR ||
|
||||
pPed->m_vehDoor == CAR_DOOR_RR)
|
||||
flags = CAR_DOOR_FLAG_LR | CAR_DOOR_FLAG_RR;
|
||||
}
|
||||
else {
|
||||
switch (pPed->m_vehEnterType) {
|
||||
switch (pPed->m_vehDoor) {
|
||||
case CAR_DOOR_LF:
|
||||
flags = pPed->m_pMyVehicle->m_nNumMaxPassengers != 0 ? CAR_DOOR_FLAG_LF : CAR_DOOR_FLAG_LF | CAR_DOOR_FLAG_LR;
|
||||
break;
|
||||
@ -821,7 +821,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
|
||||
}
|
||||
}
|
||||
pPed->m_pMyVehicle->m_nGettingOutFlags &= ~flags;
|
||||
pPed->m_pMyVehicle->ProcessOpenDoor(pPed->m_vehEnterType, NUM_STD_ANIMS, 0.0f);
|
||||
pPed->m_pMyVehicle->ProcessOpenDoor(pPed->m_vehDoor, NUM_STD_ANIMS, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2353,7 +2353,7 @@ CCamera::StartTransition(int16 newMode)
|
||||
while(deltaBeta < -PI) deltaBeta += 2*PI;
|
||||
deltaBeta = Abs(deltaBeta);
|
||||
|
||||
door = FindPlayerPed()->m_vehEnterType;
|
||||
door = FindPlayerPed()->m_vehDoor;
|
||||
if(deltaBeta > HALFPI){
|
||||
if(((CPed*)pTargetEntity)->m_carInObjective){
|
||||
if(((CPed*)pTargetEntity)->m_carInObjective->IsUpsideDown()){
|
||||
|
@ -390,8 +390,8 @@ CPlayerInfo::Process(void)
|
||||
m_pPed->SetObjective(OBJECTIVE_ENTER_CAR_AS_PASSENGER, carBelow);
|
||||
} else if (carBelow->IsBoat()) {
|
||||
if (!carBelow->pDriver) {
|
||||
m_pPed->m_vehEnterType = 0;
|
||||
m_pPed->SetEnterCar(carBelow, m_pPed->m_vehEnterType);
|
||||
m_pPed->m_vehDoor = 0;
|
||||
m_pPed->SetEnterCar(carBelow, m_pPed->m_vehDoor);
|
||||
}
|
||||
} else {
|
||||
m_pPed->SetObjective(OBJECTIVE_ENTER_CAR_AS_DRIVER, carBelow);
|
||||
|
@ -121,7 +121,7 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
|
||||
m_fRotationCur = 0.0f;
|
||||
m_headingRate = 15.0f;
|
||||
m_fRotationDest = 0.0f;
|
||||
m_vehEnterType = CAR_DOOR_LF;
|
||||
m_vehDoor = CAR_DOOR_LF;
|
||||
m_walkAroundType = 0;
|
||||
m_pCurrentPhysSurface = nil;
|
||||
m_vecOffsetFromPhysSurface = CVector(0.0f, 0.0f, 0.0f);
|
||||
@ -381,7 +381,7 @@ CPed::~CPed(void)
|
||||
GetPedAttractorManager()->DeRegisterPed(this, m_attractor);
|
||||
CRadar::ClearBlipForEntity(BLIP_CHAR, CPools::GetPedPool()->GetIndex(this));
|
||||
if (InVehicle()){
|
||||
uint8 door_flag = GetCarDoorFlag(m_vehEnterType);
|
||||
uint8 door_flag = GetCarDoorFlag(m_vehDoor);
|
||||
if (m_pMyVehicle->pDriver == this)
|
||||
m_pMyVehicle->pDriver = nil;
|
||||
else {
|
||||
@ -3656,7 +3656,7 @@ CPed::SetDirectionToWalkAroundObject(CEntity *obj)
|
||||
if (Abs(angleDiffBtwObjCenterAndForward) >= objTopRightHeading) {
|
||||
if (PI - objTopRightHeading >= Abs(angleDiffBtwObjCenterAndForward)) {
|
||||
if ((angleDiffBtwObjCenterAndForward <= 0.0f || objUpsideDown) && (angleDiffBtwObjCenterAndForward < 0.0f || !objUpsideDown)) {
|
||||
if (goingToEnterCar && (m_vehEnterType == CAR_DOOR_RF || m_vehEnterType == CAR_DOOR_RR)) {
|
||||
if (goingToEnterCar && (m_vehDoor == CAR_DOOR_RF || m_vehDoor == CAR_DOOR_RR)) {
|
||||
m_walkAroundType = 0;
|
||||
} else {
|
||||
if (CGeneral::LimitRadianAngle(m_fRotationDest - angleToFaceObjCenter) >= 0.0f) {
|
||||
@ -3674,7 +3674,7 @@ CPed::SetDirectionToWalkAroundObject(CEntity *obj)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (goingToEnterCar && (m_vehEnterType == CAR_DOOR_LF || m_vehEnterType == CAR_DOOR_LR)) {
|
||||
if (goingToEnterCar && (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR)) {
|
||||
m_walkAroundType = 0;
|
||||
} else {
|
||||
if (CGeneral::LimitRadianAngle(m_fRotationDest - angleToFaceObjCenter) <= 0.0f) {
|
||||
@ -3692,7 +3692,7 @@ CPed::SetDirectionToWalkAroundObject(CEntity *obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (goingToEnterCar && (m_vehEnterType == CAR_DOOR_LF || m_vehEnterType == CAR_DOOR_LR)
|
||||
} else if (goingToEnterCar && (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR)
|
||||
|| CGeneral::LimitRadianAngle(m_fRotationDest - angleToFaceObjCenter) < 0.0f) {
|
||||
if (entityOnTopLeftOfObj == 1 || entityOnTopLeftOfObj && !entityOnTopRightOfObj && !entityOnBottomRightOfObj) {
|
||||
m_walkAroundType = 3;
|
||||
@ -3700,7 +3700,7 @@ CPed::SetDirectionToWalkAroundObject(CEntity *obj)
|
||||
} else if (entityOnTopRightOfObj == 1 || entityOnTopRightOfObj && !entityOnTopLeftOfObj && !entityOnBottomLeftOfObj) {
|
||||
m_walkAroundType = 4;
|
||||
}
|
||||
} else if (goingToEnterCar && (m_vehEnterType == CAR_DOOR_LF || m_vehEnterType == CAR_DOOR_LR)
|
||||
} else if (goingToEnterCar && (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR)
|
||||
|| CGeneral::LimitRadianAngle(m_fRotationDest - angleToFaceObjCenter) > 0.0f) {
|
||||
if (entityOnBottomLeftOfObj == 1 || entityOnBottomLeftOfObj && !entityOnTopRightOfObj && !entityOnBottomRightOfObj) {
|
||||
m_walkAroundType = 2;
|
||||
@ -3723,10 +3723,10 @@ CPed::SetDirectionToWalkAroundObject(CEntity *obj)
|
||||
if (Abs(angleDiffBtwObjCenterAndForward) < objTopRightHeading) {
|
||||
if (goingToEnterCar) {
|
||||
if (goingToEnterCarAndItsVan) {
|
||||
if (m_vehEnterType == CAR_DOOR_LR || m_vehEnterType == CAR_DOOR_RR)
|
||||
if (m_vehDoor == CAR_DOOR_LR || m_vehDoor == CAR_DOOR_RR)
|
||||
return;
|
||||
}
|
||||
if (m_vehEnterType != CAR_DOOR_LF && m_vehEnterType != CAR_DOOR_LR && (!entityOnBottomRightOfObj || entityOnBottomLeftOfObj)) {
|
||||
if (m_vehDoor != CAR_DOOR_LF && m_vehDoor != CAR_DOOR_LR && (!entityOnBottomRightOfObj || entityOnBottomLeftOfObj)) {
|
||||
m_fRotationDest = CGeneral::LimitRadianAngle(dirToSet - HALFPI);
|
||||
localPosToHead.x = adjustedColMax.x;
|
||||
localPosToHead.z = 0.0f;
|
||||
@ -3755,9 +3755,9 @@ CPed::SetDirectionToWalkAroundObject(CEntity *obj)
|
||||
} else {
|
||||
if (PI - objTopRightHeading >= Abs(angleDiffBtwObjCenterAndForward)) {
|
||||
if (angleDiffBtwObjCenterAndForward <= 0.0f) {
|
||||
if (!goingToEnterCar || !goingToEnterCarAndItsVan || m_vehEnterType != CAR_DOOR_LR && m_vehEnterType != CAR_DOOR_RR) {
|
||||
if (!goingToEnterCar || !goingToEnterCarAndItsVan || m_vehDoor != CAR_DOOR_LR && m_vehDoor != CAR_DOOR_RR) {
|
||||
if (goingToEnterCar) {
|
||||
if (m_vehEnterType == CAR_DOOR_RF || (m_vehEnterType == CAR_DOOR_RR && !goingToEnterCarAndItsVan))
|
||||
if (m_vehDoor == CAR_DOOR_RF || (m_vehDoor == CAR_DOOR_RR && !goingToEnterCarAndItsVan))
|
||||
return;
|
||||
}
|
||||
if (m_walkAroundType == 4 || m_walkAroundType == 3
|
||||
@ -3779,14 +3779,14 @@ CPed::SetDirectionToWalkAroundObject(CEntity *obj)
|
||||
localPosToHead.z = 0.0f;
|
||||
localPosToHead.y = adjustedColMin.y;
|
||||
}
|
||||
} else if (goingToEnterCar && goingToEnterCarAndItsVan && (m_vehEnterType == CAR_DOOR_LR || m_vehEnterType == CAR_DOOR_RR)) {
|
||||
} else if (goingToEnterCar && goingToEnterCarAndItsVan && (m_vehDoor == CAR_DOOR_LR || m_vehDoor == CAR_DOOR_RR)) {
|
||||
m_fRotationDest = CGeneral::LimitRadianAngle(PI + dirToSet);
|
||||
localPosToHead.x = adjustedColMin.x;
|
||||
localPosToHead.z = 0.0f;
|
||||
localPosToHead.y = adjustedColMin.y;
|
||||
} else {
|
||||
if (goingToEnterCar) {
|
||||
if (m_vehEnterType == CAR_DOOR_LF || m_vehEnterType == CAR_DOOR_LR && !goingToEnterCarAndItsVan)
|
||||
if (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR && !goingToEnterCarAndItsVan)
|
||||
return;
|
||||
}
|
||||
if (m_walkAroundType == 1 || m_walkAroundType == 2
|
||||
@ -3804,8 +3804,8 @@ CPed::SetDirectionToWalkAroundObject(CEntity *obj)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (goingToEnterCar && (!goingToEnterCarAndItsVan || m_vehEnterType != CAR_DOOR_LR && m_vehEnterType != CAR_DOOR_RR)) {
|
||||
if (m_vehEnterType != CAR_DOOR_LF && m_vehEnterType != CAR_DOOR_LR && (!entityOnTopRightOfObj || entityOnTopLeftOfObj)) {
|
||||
if (goingToEnterCar && (!goingToEnterCarAndItsVan || m_vehDoor != CAR_DOOR_LR && m_vehDoor != CAR_DOOR_RR)) {
|
||||
if (m_vehDoor != CAR_DOOR_LF && m_vehDoor != CAR_DOOR_LR && (!entityOnTopRightOfObj || entityOnTopLeftOfObj)) {
|
||||
|
||||
m_fRotationDest = CGeneral::LimitRadianAngle(dirToSet - HALFPI);
|
||||
localPosToHead.x = adjustedColMax.x;
|
||||
@ -4099,9 +4099,9 @@ CPed::PedSetOutCarCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
}
|
||||
if (veh && veh->IsBike())
|
||||
// BUG?
|
||||
veh->m_nGettingOutFlags &= ~GetBikeDoorFlag(ped->m_vehEnterType);
|
||||
veh->m_nGettingOutFlags &= ~GetBikeDoorFlag(ped->m_vehDoor);
|
||||
else
|
||||
veh->m_nGettingOutFlags &= ~GetCarDoorFlag(ped->m_vehEnterType);
|
||||
veh->m_nGettingOutFlags &= ~GetCarDoorFlag(ped->m_vehDoor);
|
||||
|
||||
if (veh->pDriver == ped) {
|
||||
veh->RemoveDriver();
|
||||
@ -4123,7 +4123,7 @@ CPed::PedSetOutCarCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
|
||||
if (veh->bIsBus && !veh->IsUpsideDown() && !veh->IsOnItsSide()) {
|
||||
float angleAfterExit;
|
||||
if (ped->m_vehEnterType == CAR_DOOR_LF) {
|
||||
if (ped->m_vehDoor == CAR_DOOR_LF) {
|
||||
angleAfterExit = HALFPI + veh->GetForward().Heading();
|
||||
} else {
|
||||
angleAfterExit = veh->GetForward().Heading() - HALFPI;
|
||||
@ -4174,7 +4174,7 @@ CPed::PedSetDraggedOutCarCB(CAnimBlendAssociation *dragAssoc, void *arg)
|
||||
uint8 exitFlags = 0;
|
||||
quickJackedAssoc = RpAnimBlendClumpGetAssociation(ped->GetClump(), ANIM_CAR_QJACKED);
|
||||
if (dragAssoc && dragAssoc->animId == ANIM_BIKE_HIT && ped->m_pMyVehicle) {
|
||||
if (ped->m_vehEnterType == CAR_DOOR_LF || ped->m_vehEnterType == CAR_DOOR_RF) {
|
||||
if (ped->m_vehDoor == CAR_DOOR_LF || ped->m_vehDoor == CAR_DOOR_RF) {
|
||||
CAnimManager::BlendAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_BIKE_FALL_OFF, 100.0f);
|
||||
ped->m_pMyVehicle->m_nGettingOutFlags &= ~(CAR_DOOR_FLAG_RF | CAR_DOOR_FLAG_LF);
|
||||
} else {
|
||||
@ -4196,9 +4196,9 @@ CPed::PedSetDraggedOutCarCB(CAnimBlendAssociation *dragAssoc, void *arg)
|
||||
vehicle = ped->m_pMyVehicle;
|
||||
|
||||
if (vehicle && vehicle->IsBike())
|
||||
exitFlags = GetBikeDoorFlagInclJumpInFromFront(ped->m_vehEnterType);
|
||||
exitFlags = GetBikeDoorFlagInclJumpInFromFront(ped->m_vehDoor);
|
||||
else
|
||||
exitFlags = GetCarDoorFlag(ped->m_vehEnterType);
|
||||
exitFlags = GetCarDoorFlag(ped->m_vehDoor);
|
||||
|
||||
if (vehicle)
|
||||
vehicle->m_nGettingOutFlags &= ~exitFlags;
|
||||
@ -4419,7 +4419,7 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
} else if (veh->bIsBus) {
|
||||
veh->AddPassenger(ped);
|
||||
} else {
|
||||
switch (ped->m_vehEnterType) {
|
||||
switch (ped->m_vehDoor) {
|
||||
case CAR_DOOR_RF:
|
||||
veh->AddPassenger(ped, 0);
|
||||
break;
|
||||
@ -4449,9 +4449,9 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
|
||||
int8 doorFlag;
|
||||
if (veh->IsBike()) {
|
||||
doorFlag = GetBikeDoorFlagInclJumpInFromFront(ped->m_vehEnterType);
|
||||
doorFlag = GetBikeDoorFlagInclJumpInFromFront(ped->m_vehDoor);
|
||||
} else {
|
||||
doorFlag = GetEnterCarDoorFlag(ped->m_vehEnterType, veh->m_nNumMaxPassengers);
|
||||
doorFlag = GetEnterCarDoorFlag(ped->m_vehDoor, veh->m_nNumMaxPassengers);
|
||||
}
|
||||
|
||||
veh->m_nGettingInFlags &= ~doorFlag;
|
||||
@ -5133,13 +5133,13 @@ void
|
||||
CPed::Idle(void)
|
||||
{
|
||||
CVehicle *veh = m_pMyVehicle;
|
||||
if (veh && veh->m_nGettingOutFlags && m_vehEnterType) {
|
||||
if (veh && veh->m_nGettingOutFlags && m_vehDoor) {
|
||||
|
||||
if (veh->m_nGettingOutFlags & GetCarDoorFlag(m_vehEnterType)) {
|
||||
if (veh->m_nGettingOutFlags & GetCarDoorFlag(m_vehDoor)) {
|
||||
|
||||
if (m_objective != OBJECTIVE_KILL_CHAR_ON_FOOT) {
|
||||
|
||||
CVector doorPos = GetPositionToOpenCarDoor(veh, m_vehEnterType);
|
||||
CVector doorPos = GetPositionToOpenCarDoor(veh, m_vehDoor);
|
||||
CVector doorDist = GetPosition() - doorPos;
|
||||
|
||||
if (doorDist.MagnitudeSqr() < sq(0.5f)) {
|
||||
@ -7480,7 +7480,7 @@ CPed::SetSeekCar(CVehicle *car, uint32 doorNode)
|
||||
m_pMyVehicle = car;
|
||||
m_pMyVehicle->RegisterReference((CEntity**) &m_pMyVehicle);
|
||||
// m_pSeekTarget->RegisterReference((CEntity**) &m_pSeekTarget);
|
||||
m_vehEnterType = doorNode;
|
||||
m_vehDoor = doorNode;
|
||||
m_distanceToCountSeekDone = 0.5f;
|
||||
SetPedState(PED_SEEK_CAR);
|
||||
|
||||
@ -7498,9 +7498,9 @@ CPed::SeekCar(void)
|
||||
}
|
||||
|
||||
if (m_objective != OBJECTIVE_ENTER_CAR_AS_PASSENGER) {
|
||||
if (!vehToSeek->IsBike() && m_vehEnterType && m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER) {
|
||||
if (!vehToSeek->IsBike() && m_vehDoor && m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER) {
|
||||
if (IsRoomToBeCarJacked()) {
|
||||
dest = GetPositionToOpenCarDoor(vehToSeek, m_vehEnterType);
|
||||
dest = GetPositionToOpenCarDoor(vehToSeek, m_vehDoor);
|
||||
} else if (m_nPedType == PEDTYPE_COP) {
|
||||
dest = GetPositionToOpenCarDoor(vehToSeek, CAR_DOOR_RF);
|
||||
} else {
|
||||
@ -7581,7 +7581,7 @@ CPed::SeekCar(void)
|
||||
else if (2.0f * vehToSeek->GetColModel()->boundingBox.max.x > distToDestSqr)
|
||||
bCanPedEnterSeekedCar = true;
|
||||
|
||||
if (vehToSeek->m_nGettingInFlags & GetCarDoorFlag(m_vehEnterType))
|
||||
if (vehToSeek->m_nGettingInFlags & GetCarDoorFlag(m_vehDoor))
|
||||
bVehEnterDoorIsBlocked = true;
|
||||
else
|
||||
bVehEnterDoorIsBlocked = false;
|
||||
@ -7592,7 +7592,7 @@ CPed::SeekCar(void)
|
||||
if (1.6f + GetPosition().z > dest.z && GetPosition().z - 0.5f < dest.z) {
|
||||
#ifdef GTA_TRAIN
|
||||
if (vehToSeek->IsTrain()) {
|
||||
SetEnterTrain(vehToSeek, m_vehEnterType);
|
||||
SetEnterTrain(vehToSeek, m_vehDoor);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
@ -7613,42 +7613,42 @@ CPed::SeekCar(void)
|
||||
case STATUS_PLAYER_DISABLED:
|
||||
if (vehToSeek->IsBike()) {
|
||||
if ((!m_leader || m_leader != vehToSeek->pDriver) &&
|
||||
((m_vehEnterType == CAR_DOOR_LF || m_vehEnterType == CAR_DOOR_RF || m_vehEnterType == CAR_WINDSCREEN) && vehToSeek->pDriver ||
|
||||
(m_vehEnterType == CAR_DOOR_LR || m_vehEnterType == CAR_DOOR_RR) && vehToSeek->pPassengers[0])) {
|
||||
((m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_RF || m_vehDoor == CAR_WINDSCREEN) && vehToSeek->pDriver ||
|
||||
(m_vehDoor == CAR_DOOR_LR || m_vehDoor == CAR_DOOR_RR) && vehToSeek->pPassengers[0])) {
|
||||
SetCarJack(vehToSeek);
|
||||
} else {
|
||||
SetEnterCar(vehToSeek, m_vehEnterType);
|
||||
SetEnterCar(vehToSeek, m_vehDoor);
|
||||
}
|
||||
} else if (!vehToSeek->bIsBus && (!m_leader || m_leader != vehToSeek->pDriver) &&
|
||||
(m_vehEnterType == CAR_DOOR_LF && vehToSeek->pDriver || m_vehEnterType == CAR_DOOR_RF && vehToSeek->pPassengers[0] || m_vehEnterType == CAR_DOOR_LR && vehToSeek->pPassengers[1] || m_vehEnterType == CAR_DOOR_RR && vehToSeek->pPassengers[2])) {
|
||||
(m_vehDoor == CAR_DOOR_LF && vehToSeek->pDriver || m_vehDoor == CAR_DOOR_RF && vehToSeek->pPassengers[0] || m_vehDoor == CAR_DOOR_LR && vehToSeek->pPassengers[1] || m_vehDoor == CAR_DOOR_RR && vehToSeek->pPassengers[2])) {
|
||||
SetCarJack(vehToSeek);
|
||||
if (m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER && m_vehEnterType != CAR_DOOR_LF)
|
||||
if (m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER && m_vehDoor != CAR_DOOR_LF)
|
||||
vehToSeek->pDriver->bFleeAfterExitingCar = true;
|
||||
} else {
|
||||
SetEnterCar(vehToSeek, m_vehEnterType);
|
||||
SetEnterCar(vehToSeek, m_vehDoor);
|
||||
}
|
||||
break;
|
||||
case STATUS_ABANDONED:
|
||||
if (vehToSeek->IsBike()) {
|
||||
if ((m_vehEnterType == CAR_DOOR_LR || m_vehEnterType == CAR_DOOR_RR) && vehToSeek->pPassengers[0]) {
|
||||
if ((m_vehDoor == CAR_DOOR_LR || m_vehDoor == CAR_DOOR_RR) && vehToSeek->pPassengers[0]) {
|
||||
if (vehToSeek->pPassengers[0]->bDontDragMeOutCar) {
|
||||
if (IsPlayer())
|
||||
SetEnterCar(vehToSeek, m_vehEnterType);
|
||||
SetEnterCar(vehToSeek, m_vehDoor);
|
||||
} else {
|
||||
SetCarJack(vehToSeek);
|
||||
}
|
||||
} else {
|
||||
SetEnterCar(vehToSeek, m_vehEnterType);
|
||||
SetEnterCar(vehToSeek, m_vehDoor);
|
||||
}
|
||||
} else if (m_vehEnterType == CAR_DOOR_RF && vehToSeek->pPassengers[0]) {
|
||||
} else if (m_vehDoor == CAR_DOOR_RF && vehToSeek->pPassengers[0]) {
|
||||
if (vehToSeek->pPassengers[0]->bDontDragMeOutCar) {
|
||||
if (IsPlayer())
|
||||
SetEnterCar(vehToSeek, m_vehEnterType);
|
||||
SetEnterCar(vehToSeek, m_vehDoor);
|
||||
} else {
|
||||
SetCarJack(vehToSeek);
|
||||
}
|
||||
} else {
|
||||
SetEnterCar(vehToSeek, m_vehEnterType);
|
||||
SetEnterCar(vehToSeek, m_vehDoor);
|
||||
}
|
||||
break;
|
||||
case STATUS_WRECKED:
|
||||
@ -8980,7 +8980,7 @@ CPed::SetSolicit(uint32 time)
|
||||
|
||||
if (CharCreatedBy != MISSION_CHAR && m_carInObjective->m_nNumGettingIn == 0
|
||||
&& CTimer::GetTimeInMilliseconds() < m_objectiveTimer) {
|
||||
if (m_vehEnterType == CAR_DOOR_LF) {
|
||||
if (m_vehDoor == CAR_DOOR_LF) {
|
||||
m_fRotationDest = m_carInObjective->GetForward().Heading() - HALFPI;
|
||||
} else {
|
||||
m_fRotationDest = m_carInObjective->GetForward().Heading() + HALFPI;
|
||||
@ -9002,7 +9002,7 @@ void
|
||||
CPed::Solicit(void)
|
||||
{
|
||||
if (m_standardTimer >= CTimer::GetTimeInMilliseconds() && m_carInObjective) {
|
||||
CVector doorPos = GetPositionToOpenCarDoor(m_carInObjective, m_vehEnterType, 0.0f);
|
||||
CVector doorPos = GetPositionToOpenCarDoor(m_carInObjective, m_vehDoor, 0.0f);
|
||||
Say(SOUND_PED_SOLICIT);
|
||||
if (FindPlayerVehicle() == m_carInObjective) {
|
||||
FindPlayerPed()->Say(SOUND_PED_SOLICIT);
|
||||
@ -9138,7 +9138,7 @@ CPed::PossiblyFindBetterPosToSeekCar(CVector *pos, CVehicle *veh)
|
||||
bool canHeadToRf = NTVF_RF <= 0.0f || NTVF_RF >= HALFPI;
|
||||
|
||||
// Only order of conditions are different among enterTypes.
|
||||
if (m_vehEnterType == CAR_DOOR_RR) {
|
||||
if (m_vehDoor == CAR_DOOR_RR) {
|
||||
if (canHeadToRr) {
|
||||
foundPos = rightRearPos;
|
||||
foundIt = true;
|
||||
@ -9152,7 +9152,7 @@ CPed::PossiblyFindBetterPosToSeekCar(CVector *pos, CVehicle *veh)
|
||||
foundPos = leftFrontPos;
|
||||
foundIt = true;
|
||||
}
|
||||
} else if(m_vehEnterType == CAR_DOOR_RF) {
|
||||
} else if(m_vehDoor == CAR_DOOR_RF) {
|
||||
if (canHeadToRf) {
|
||||
foundPos = rightFrontPos;
|
||||
foundIt = true;
|
||||
@ -9166,7 +9166,7 @@ CPed::PossiblyFindBetterPosToSeekCar(CVector *pos, CVehicle *veh)
|
||||
foundPos = leftRearPos;
|
||||
foundIt = true;
|
||||
}
|
||||
} else if (m_vehEnterType == CAR_DOOR_LF) {
|
||||
} else if (m_vehDoor == CAR_DOOR_LF) {
|
||||
if (canHeadToLf) {
|
||||
foundPos = leftFrontPos;
|
||||
foundIt = true;
|
||||
@ -9180,7 +9180,7 @@ CPed::PossiblyFindBetterPosToSeekCar(CVector *pos, CVehicle *veh)
|
||||
foundPos = rightRearPos;
|
||||
foundIt = true;
|
||||
}
|
||||
} else if (m_vehEnterType == CAR_DOOR_LR) {
|
||||
} else if (m_vehDoor == CAR_DOOR_LR) {
|
||||
if (canHeadToLr) {
|
||||
foundPos = leftRearPos;
|
||||
foundIt = true;
|
||||
|
@ -559,7 +559,7 @@ public:
|
||||
float m_fRotationCur;
|
||||
float m_fRotationDest;
|
||||
float m_headingRate;
|
||||
uint16 m_vehEnterType;
|
||||
uint16 m_vehDoor;
|
||||
int16 m_walkAroundType;
|
||||
CPhysical *m_pCurrentPhysSurface;
|
||||
CVector m_vecOffsetFromPhysSurface;
|
||||
|
@ -1178,7 +1178,7 @@ CPed::ProcessObjective(void)
|
||||
bool foundSeat = false;
|
||||
if (m_carInObjective->IsBike()) {
|
||||
if (!m_carInObjective->pPassengers[0] && !(m_carInObjective->m_nGettingInFlags & (CAR_DOOR_FLAG_RR | CAR_DOOR_FLAG_LR))) {
|
||||
m_vehEnterType = CAR_DOOR_RR;
|
||||
m_vehDoor = CAR_DOOR_RR;
|
||||
foundSeat = true;
|
||||
}
|
||||
} else {
|
||||
@ -1187,27 +1187,27 @@ CPed::ProcessObjective(void)
|
||||
if (m_carInObjective->pPassengers[2] || m_carInObjective->m_nGettingInFlags & CAR_DOOR_FLAG_RR) {
|
||||
foundSeat = false;
|
||||
} else {
|
||||
m_vehEnterType = CAR_DOOR_RR;
|
||||
m_vehDoor = CAR_DOOR_RR;
|
||||
foundSeat = true;
|
||||
}
|
||||
} else {
|
||||
m_vehEnterType = CAR_DOOR_LR;
|
||||
m_vehDoor = CAR_DOOR_LR;
|
||||
foundSeat = true;
|
||||
}
|
||||
} else {
|
||||
m_vehEnterType = CAR_DOOR_RF;
|
||||
m_vehDoor = CAR_DOOR_RF;
|
||||
foundSeat = true;
|
||||
}
|
||||
}
|
||||
for (int i = 2; i < m_carInObjective->m_nNumMaxPassengers; ++i) {
|
||||
if (!m_carInObjective->pPassengers[i] && !(m_carInObjective->m_nGettingInFlags & CAR_DOOR_FLAG_RF)) {
|
||||
m_vehEnterType = CAR_DOOR_RF;
|
||||
m_vehDoor = CAR_DOOR_RF;
|
||||
foundSeat = true;
|
||||
}
|
||||
}
|
||||
if (foundSeat) {
|
||||
SetPosition(GetPositionToOpenCarDoor(m_carInObjective, m_vehEnterType));
|
||||
SetEnterCar(m_carInObjective, m_vehEnterType);
|
||||
SetPosition(GetPositionToOpenCarDoor(m_carInObjective, m_vehDoor));
|
||||
SetEnterCar(m_carInObjective, m_vehDoor);
|
||||
}
|
||||
}
|
||||
m_objectiveTimer = 0;
|
||||
@ -2337,7 +2337,7 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ped->m_vehEnterType) {
|
||||
if (!ped->m_vehDoor) {
|
||||
ped->QuitEnteringCar();
|
||||
return;
|
||||
}
|
||||
@ -2351,7 +2351,7 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
bool itsLow = !!veh->bLowVehicle;
|
||||
eDoors enterDoor;
|
||||
|
||||
switch (ped->m_vehEnterType) {
|
||||
switch (ped->m_vehDoor) {
|
||||
case CAR_DOOR_RF:
|
||||
itsVan = false;
|
||||
enterDoor = DOOR_FRONT_RIGHT;
|
||||
@ -2373,7 +2373,7 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
if (veh->IsBike()) {
|
||||
CPed *pedToDragOut = nil;
|
||||
if (veh->GetStatus() == STATUS_ABANDONED) {
|
||||
if (ped->m_vehEnterType == CAR_WINDSCREEN) {
|
||||
if (ped->m_vehDoor == CAR_WINDSCREEN) {
|
||||
ped->m_pVehicleAnim = CAnimManager::BlendAnimation(ped->GetClump(), ((CBike*)veh)->m_bikeAnimType, ANIM_BIKE_KICK, 6.0f);
|
||||
ped->m_pVehicleAnim->SetFinishCallback(PedAnimGetInCB, ped);
|
||||
((CBike*)veh)->bIsBeingPickedUp = true;
|
||||
@ -2399,7 +2399,7 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
ped->m_pVehicleAnim->SetFinishCallback(PedAnimGetInCB, ped);
|
||||
((CBike*)veh)->bIsBeingPickedUp = true;
|
||||
}
|
||||
} else if (ped->m_vehEnterType == CAR_WINDSCREEN) {
|
||||
} else if (ped->m_vehDoor == CAR_WINDSCREEN) {
|
||||
if (veh->pDriver->m_nPedState != PED_DRIVING || veh->pDriver->bDontDragMeOutCar) {
|
||||
ped->QuitEnteringCar();
|
||||
} else {
|
||||
@ -2413,7 +2413,7 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
if (veh->pDriver) {
|
||||
if (veh->m_vecMoveSpeed.Magnitude() > 0.2f) {
|
||||
ped->QuitEnteringCar();
|
||||
ped->SetFall(1000, ped->m_vehEnterType == CAR_DOOR_LF || ped->m_vehEnterType == CAR_DOOR_LR ? ANIM_KO_SPIN_L : ANIM_KO_SPIN_R, false);
|
||||
ped->SetFall(1000, ped->m_vehDoor == CAR_DOOR_LF || ped->m_vehDoor == CAR_DOOR_LR ? ANIM_KO_SPIN_L : ANIM_KO_SPIN_R, false);
|
||||
return;
|
||||
}
|
||||
if (veh->pDriver->m_nPedState != PED_DRIVING || veh->pDriver->bDontDragMeOutCar) {
|
||||
@ -2434,7 +2434,7 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
if (veh->pPassengers[0]) {
|
||||
if (veh->m_vecMoveSpeed.Magnitude() > 0.2f) {
|
||||
ped->QuitEnteringCar();
|
||||
ped->SetFall(1000, ped->m_vehEnterType == CAR_DOOR_LF || ped->m_vehEnterType == CAR_DOOR_LR ? ANIM_KO_SPIN_L : ANIM_KO_SPIN_R, false);
|
||||
ped->SetFall(1000, ped->m_vehDoor == CAR_DOOR_LF || ped->m_vehDoor == CAR_DOOR_LR ? ANIM_KO_SPIN_L : ANIM_KO_SPIN_R, false);
|
||||
return;
|
||||
}
|
||||
if (veh->pPassengers[0]->m_nPedState != PED_DRIVING || veh->pPassengers[0]->bDontDragMeOutCar) {
|
||||
@ -2457,7 +2457,7 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
}
|
||||
|
||||
if (pedToDragOut) {
|
||||
pedToDragOut->SetBeingDraggedFromCar(veh, ped->m_vehEnterType, false);
|
||||
pedToDragOut->SetBeingDraggedFromCar(veh, ped->m_vehDoor, false);
|
||||
if (pedToDragOut->IsGangMember())
|
||||
pedToDragOut->RegisterThreatWithGangPeds(ped);
|
||||
|
||||
@ -2535,7 +2535,7 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
}
|
||||
|
||||
if (player != veh->pDriver) {
|
||||
veh->pDriver->SetBeingDraggedFromCar(veh, ped->m_vehEnterType, true);
|
||||
veh->pDriver->SetBeingDraggedFromCar(veh, ped->m_vehDoor, true);
|
||||
if (veh->pDriver->IsGangMember())
|
||||
veh->pDriver->RegisterThreatWithGangPeds(ped);
|
||||
}
|
||||
@ -2585,7 +2585,7 @@ CPed::PedAnimDoorOpenCB(CAnimBlendAssociation* animAssoc, void* arg)
|
||||
|
||||
eDoors door;
|
||||
CPed *pedInSeat = nil;
|
||||
switch (ped->m_vehEnterType) {
|
||||
switch (ped->m_vehDoor) {
|
||||
case CAR_DOOR_RF:
|
||||
door = DOOR_FRONT_RIGHT;
|
||||
pedInSeat = veh->pPassengers[0];
|
||||
@ -2643,21 +2643,21 @@ CPed::PedAnimDoorOpenCB(CAnimBlendAssociation* animAssoc, void* arg)
|
||||
if (veh->m_vecMoveSpeed.Magnitude() > 0.2f ||
|
||||
veh->IsCar() && veh->GetVehicleAppearance() == VEHICLE_APPEARANCE_HELI && ((CAutomobile*)veh)->m_nWheelsOnGround == 0) {
|
||||
ped->QuitEnteringCar();
|
||||
if (ped->m_vehEnterType != CAR_DOOR_LF && ped->m_vehEnterType != CAR_DOOR_LR)
|
||||
if (ped->m_vehDoor != CAR_DOOR_LF && ped->m_vehDoor != CAR_DOOR_LR)
|
||||
ped->SetFall(1000, ANIM_KO_SPIN_R, false);
|
||||
else
|
||||
ped->SetFall(1000, ANIM_KO_SPIN_L, false);
|
||||
|
||||
return;
|
||||
}
|
||||
veh->ProcessOpenDoor(ped->m_vehEnterType, ANIM_CAR_OPEN_LHS, 1.0f);
|
||||
veh->ProcessOpenDoor(ped->m_vehDoor, ANIM_CAR_OPEN_LHS, 1.0f);
|
||||
|
||||
if (ped->m_vehEnterType == CAR_DOOR_LF || ped->m_vehEnterType == CAR_DOOR_RF)
|
||||
if (ped->m_vehDoor == CAR_DOOR_LF || ped->m_vehDoor == CAR_DOOR_RF)
|
||||
isVan = false;
|
||||
|
||||
if (ped->m_nPedState != PED_CARJACK || isBus) {
|
||||
|
||||
if (ped->m_vehEnterType == CAR_DOOR_LF || ped->m_vehEnterType == CAR_DOOR_LR) {
|
||||
if (ped->m_vehDoor == CAR_DOOR_LF || ped->m_vehDoor == CAR_DOOR_LR) {
|
||||
if (veh->IsBike()) {
|
||||
ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ((CBike*)veh)->m_bikeAnimType, ANIM_BIKE_JUMPON_R);
|
||||
} else if (isVan) {
|
||||
@ -2682,14 +2682,14 @@ CPed::PedAnimDoorOpenCB(CAnimBlendAssociation* animAssoc, void* arg)
|
||||
ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ASSOCGRP_STD, ANIM_CAR_GETIN_RHS);
|
||||
}
|
||||
|
||||
if (ped->m_vehEnterType == CAR_DOOR_RF && pedInSeat && veh->IsCar())
|
||||
if (ped->m_vehDoor == CAR_DOOR_RF && pedInSeat && veh->IsCar())
|
||||
pedInSeat->SetObjective(OBJECTIVE_LEAVE_CAR, veh);
|
||||
}
|
||||
|
||||
ped->m_pVehicleAnim->SetFinishCallback(PedAnimGetInCB, ped);
|
||||
} else {
|
||||
CPed *pedToDragOut = nil;
|
||||
switch (ped->m_vehEnterType) {
|
||||
switch (ped->m_vehDoor) {
|
||||
case CAR_DOOR_RF: pedToDragOut = veh->pPassengers[0]; break;
|
||||
case CAR_DOOR_RR: pedToDragOut = veh->pPassengers[2]; break;
|
||||
case CAR_DOOR_LF: pedToDragOut = veh->pDriver; break;
|
||||
@ -2703,7 +2703,7 @@ CPed::PedAnimDoorOpenCB(CAnimBlendAssociation* animAssoc, void* arg)
|
||||
((CCopPed*)ped)->SetArrestPlayer(ped->m_pedInObjective);
|
||||
}
|
||||
|
||||
if (ped->m_vehEnterType != CAR_DOOR_LF && ped->m_vehEnterType != CAR_DOOR_LR) {
|
||||
if (ped->m_vehDoor != CAR_DOOR_LF && ped->m_vehDoor != CAR_DOOR_LR) {
|
||||
|
||||
if (pedToDragOut && !pedToDragOut->bDontDragMeOutCar) {
|
||||
if (pedToDragOut->m_nPedState != PED_DRIVING) {
|
||||
@ -2773,7 +2773,7 @@ CPed::PedAnimDoorOpenCB(CAnimBlendAssociation* animAssoc, void* arg)
|
||||
}
|
||||
|
||||
if (player != pedToDragOut) {
|
||||
pedToDragOut->SetBeingDraggedFromCar(veh, ped->m_vehEnterType, false);
|
||||
pedToDragOut->SetBeingDraggedFromCar(veh, ped->m_vehDoor, false);
|
||||
if (pedToDragOut->IsGangMember())
|
||||
pedToDragOut->RegisterThreatWithGangPeds(ped);
|
||||
}
|
||||
@ -2844,7 +2844,7 @@ CPed::PedAnimPullPedOutCB(CAnimBlendAssociation* animAssoc, void* arg)
|
||||
}
|
||||
|
||||
if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER) {
|
||||
if (ped->m_vehEnterType == CAR_DOOR_LF || ped->m_vehEnterType == CAR_DOOR_LR) {
|
||||
if (ped->m_vehDoor == CAR_DOOR_LF || ped->m_vehDoor == CAR_DOOR_LR) {
|
||||
if (veh->IsBike())
|
||||
ped->m_pVehicleAnim = CAnimManager::AddAnimation(ped->GetClump(), ((CBike*)veh)->m_bikeAnimType, ANIM_BIKE_JUMPON_R);
|
||||
else if (isLow)
|
||||
@ -2901,7 +2901,7 @@ CPed::PedAnimGetInCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (ped->IsPlayer() && ped->m_vehEnterType == CAR_DOOR_LF
|
||||
if (ped->IsPlayer() && ped->m_vehDoor == CAR_DOOR_LF
|
||||
&& (Pads[0].GetAccelerate() >= 255.0f || Pads[0].GetBrake() >= 255.0f)
|
||||
&& veh->IsCar() && !veh->pDriver) {
|
||||
|
||||
@ -2920,7 +2920,7 @@ CPed::PedAnimGetInCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
bool isBus = !!veh->bIsBus;
|
||||
bool isLow = !!veh->bLowVehicle;
|
||||
eDoors enterDoor;
|
||||
switch (ped->m_vehEnterType) {
|
||||
switch (ped->m_vehDoor) {
|
||||
case CAR_DOOR_RF:
|
||||
isVan = false;
|
||||
enterDoor = DOOR_FRONT_RIGHT;
|
||||
@ -2966,7 +2966,7 @@ CPed::PedAnimGetInCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
ped->m_leaveCarTimer = CTimer::GetTimeInMilliseconds() + 400;
|
||||
return;
|
||||
}
|
||||
if (driver != ped && ped->m_vehEnterType != CAR_DOOR_LF) {
|
||||
if (driver != ped && ped->m_vehDoor != CAR_DOOR_LF) {
|
||||
if (!driver->IsPlayer()) {
|
||||
driver->bUsePedNodeSeek = true;
|
||||
driver->m_pLastPathNode = nil;
|
||||
@ -3049,10 +3049,10 @@ CPed::PedAnimDoorCloseCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
bool isLow = !!veh->bLowVehicle;
|
||||
|
||||
if (!veh->bIsBus)
|
||||
veh->ProcessOpenDoor(ped->m_vehEnterType, ANIM_CAR_CLOSEDOOR_LHS, 1.0f);
|
||||
veh->ProcessOpenDoor(ped->m_vehDoor, ANIM_CAR_CLOSEDOOR_LHS, 1.0f);
|
||||
|
||||
eDoors door;
|
||||
switch (ped->m_vehEnterType) {
|
||||
switch (ped->m_vehDoor) {
|
||||
case CAR_DOOR_RF: door = DOOR_FRONT_RIGHT; break;
|
||||
case CAR_DOOR_RR: door = DOOR_REAR_RIGHT; break;
|
||||
case CAR_DOOR_LF: door = DOOR_FRONT_LEFT; break;
|
||||
@ -3065,7 +3065,7 @@ CPed::PedAnimDoorCloseCB(CAnimBlendAssociation *animAssoc, void *arg)
|
||||
|
||||
if (door == DOOR_FRONT_LEFT || ped->m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER || veh->bIsBus || veh->m_nNumMaxPassengers == 0) {
|
||||
PedSetInCarCB(nil, ped);
|
||||
} else if (ped->m_vehEnterType == CAR_DOOR_RF
|
||||
} else if (ped->m_vehDoor == CAR_DOOR_RF
|
||||
&& (veh->m_nGettingInFlags & CAR_DOOR_FLAG_LF ||
|
||||
(veh->pDriver != nil &&
|
||||
(veh->pDriver->m_objective != OBJECTIVE_LEAVE_CAR
|
||||
@ -3218,7 +3218,7 @@ CPed::PedAnimStepOutCarCB(CAnimBlendAssociation* animAssoc, void* arg)
|
||||
veh->m_vecMoveSpeed += CVector(0.001f, 0.001f, 0.001f);
|
||||
veh->m_vecTurnSpeed += CVector(0.001f, 0.001f, 0.001f);
|
||||
if (!veh->bIsBus)
|
||||
veh->ProcessOpenDoor(ped->m_vehEnterType, ANIM_CAR_GETOUT_LHS, 1.0f);
|
||||
veh->ProcessOpenDoor(ped->m_vehDoor, ANIM_CAR_GETOUT_LHS, 1.0f);
|
||||
|
||||
/*
|
||||
// Duplicate and only in PC for some reason
|
||||
@ -3228,7 +3228,7 @@ CPed::PedAnimStepOutCarCB(CAnimBlendAssociation* animAssoc, void* arg)
|
||||
}
|
||||
*/
|
||||
eDoors door;
|
||||
switch (ped->m_vehEnterType) {
|
||||
switch (ped->m_vehDoor) {
|
||||
case CAR_DOOR_RF:
|
||||
door = DOOR_FRONT_RIGHT;
|
||||
break;
|
||||
@ -3397,7 +3397,7 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
||||
if (veh->GetUp().z <= -0.8f)
|
||||
vehIsUpsideDown = true;
|
||||
|
||||
if (m_vehEnterType == CAR_DOOR_RF || m_vehEnterType == CAR_DOOR_RR) {
|
||||
if (m_vehDoor == CAR_DOOR_RF || m_vehDoor == CAR_DOOR_RR) {
|
||||
if (vehIsUpsideDown) {
|
||||
m_fRotationDest = -PI + veh->GetForward().Heading();
|
||||
} else if (veh->bIsBus) {
|
||||
@ -3405,7 +3405,7 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
||||
} else {
|
||||
m_fRotationDest = veh->GetForward().Heading();
|
||||
}
|
||||
} else if (m_vehEnterType == CAR_DOOR_LF || m_vehEnterType == CAR_DOOR_LR) {
|
||||
} else if (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR) {
|
||||
if (vehIsUpsideDown) {
|
||||
m_fRotationDest = veh->GetForward().Heading();
|
||||
} else if (veh->bIsBus) {
|
||||
@ -3420,7 +3420,7 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
||||
m_fRotationDest = veh->GetForward().Heading();
|
||||
} else if (veh->bIsBus) {
|
||||
m_fRotationDest = 0.5f * PI + veh->GetForward().Heading();
|
||||
} else if (m_vehEnterType == CAR_WINDSCREEN) {
|
||||
} else if (m_vehDoor == CAR_WINDSCREEN) {
|
||||
m_fRotationDest = veh->GetForward().Heading() + PI;
|
||||
} else {
|
||||
m_fRotationDest = veh->GetForward().Heading();
|
||||
@ -3528,7 +3528,7 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
||||
if (phase == LINE_UP_TO_CAR_2) {
|
||||
neededPos = GetPosition();
|
||||
} else {
|
||||
neededPos = GetPositionToOpenCarDoor(veh, m_vehEnterType, seatPosMult);
|
||||
neededPos = GetPositionToOpenCarDoor(veh, m_vehDoor, seatPosMult);
|
||||
}
|
||||
|
||||
autoZPos = neededPos;
|
||||
@ -3645,13 +3645,13 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
||||
SetHeading(m_fRotationCur);
|
||||
} else {
|
||||
CMatrix vehDoorMat(veh->GetMatrix());
|
||||
vehDoorMat.GetPosition() += Multiply3x3(vehDoorMat, GetLocalPositionToOpenCarDoor(veh, m_vehEnterType, 0.0f));
|
||||
vehDoorMat.GetPosition() += Multiply3x3(vehDoorMat, GetLocalPositionToOpenCarDoor(veh, m_vehDoor, 0.0f));
|
||||
|
||||
if (m_vehEnterType == CAR_WINDSCREEN || veh->bIsBus) {
|
||||
if (m_vehDoor == CAR_WINDSCREEN || veh->bIsBus) {
|
||||
CMatrix correctionMat;
|
||||
if (veh->bIsBus && (m_vehEnterType == CAR_DOOR_LF || m_vehEnterType == CAR_DOOR_LR))
|
||||
if (veh->bIsBus && (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR))
|
||||
correctionMat.SetRotateZ(-HALFPI);
|
||||
else if (veh->bIsBus && (m_vehEnterType == CAR_DOOR_RF || m_vehEnterType == CAR_DOOR_RR))
|
||||
else if (veh->bIsBus && (m_vehDoor == CAR_DOOR_RF || m_vehDoor == CAR_DOOR_RR))
|
||||
correctionMat.SetRotateZ(HALFPI);
|
||||
else
|
||||
correctionMat.SetRotateZ(PI);
|
||||
@ -3675,7 +3675,7 @@ CPed::SetCarJack(CVehicle* car)
|
||||
return;
|
||||
|
||||
if (car->IsBike()) {
|
||||
switch (m_vehEnterType) {
|
||||
switch (m_vehDoor) {
|
||||
case CAR_DOOR_RF:
|
||||
doorFlag = CAR_DOOR_FLAG_LF | CAR_DOOR_FLAG_RF;
|
||||
door = DOOR_FRONT_RIGHT;
|
||||
@ -3702,7 +3702,7 @@ CPed::SetCarJack(CVehicle* car)
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (m_vehEnterType) {
|
||||
switch (m_vehDoor) {
|
||||
case CAR_DOOR_RF:
|
||||
doorFlag = CAR_DOOR_FLAG_RF;
|
||||
door = DOOR_FRONT_RIGHT;
|
||||
@ -3743,7 +3743,7 @@ CPed::SetCarJack(CVehicle* car)
|
||||
if (m_nPedState != PED_CARJACK && !m_pVehicleAnim)
|
||||
if ((car->IsDoorReady(door) || car->IsDoorFullyOpen(door)))
|
||||
if (!car->bIsBeingCarJacked && !(doorFlag & car->m_nGettingInFlags) && !(doorFlag & car->m_nGettingOutFlags))
|
||||
SetCarJack_AllClear(car, m_vehEnterType, doorFlag);
|
||||
SetCarJack_AllClear(car, m_vehDoor, doorFlag);
|
||||
}
|
||||
|
||||
// --MIAMI: Done
|
||||
@ -3767,7 +3767,7 @@ CPed::SetCarJack_AllClear(CVehicle* car, uint32 doorNode, uint32 doorFlag)
|
||||
Say(SOUND_PED_CAR_JACKING, 1000);
|
||||
|
||||
CVector carEnterPos;
|
||||
carEnterPos = GetPositionToOpenCarDoor(car, m_vehEnterType);
|
||||
carEnterPos = GetPositionToOpenCarDoor(car, m_vehDoor);
|
||||
|
||||
car->m_nGettingInFlags |= doorFlag;
|
||||
m_vecOffsetSeek = carEnterPos - GetPosition();
|
||||
@ -3780,7 +3780,7 @@ CPed::SetCarJack_AllClear(CVehicle* car, uint32 doorNode, uint32 doorFlag)
|
||||
float zDiff = Max(0.0f, carEnterPos.z - GetPosition().z);
|
||||
bUsesCollision = false;
|
||||
|
||||
if (m_vehEnterType == CAR_DOOR_LF || m_vehEnterType == CAR_DOOR_LR)
|
||||
if (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR)
|
||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, zDiff > 4.4f ? ANIM_CAR_ALIGNHI_LHS : ANIM_CAR_ALIGN_LHS, 4.0f);
|
||||
else
|
||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, zDiff > 4.4f ? ANIM_CAR_ALIGNHI_RHS : ANIM_CAR_ALIGN_RHS, 4.0f);
|
||||
@ -3806,14 +3806,14 @@ CPed::SetBeingDraggedFromCar(CVehicle *veh, uint32 vehEnterType, bool quickJack)
|
||||
if (veh->IsBike()) {
|
||||
((CBike*)veh)->bIsBeingPickedUp = true;
|
||||
if (veh->pPassengers[0] != this && (vehEnterType != CAR_WINDSCREEN || veh->pPassengers[0]))
|
||||
m_vehEnterType = CAR_DOOR_LF;
|
||||
m_vehDoor = CAR_DOOR_LF;
|
||||
else
|
||||
m_vehEnterType = CAR_DOOR_LR;
|
||||
m_vehDoor = CAR_DOOR_LR;
|
||||
} else {
|
||||
m_vehEnterType = vehEnterType;
|
||||
m_vehDoor = vehEnterType;
|
||||
}
|
||||
|
||||
if (m_vehEnterType == CAR_DOOR_LF) {
|
||||
if (m_vehDoor == CAR_DOOR_LF) {
|
||||
if (veh->pDriver && veh->pDriver->IsPlayer())
|
||||
veh->SetStatus(STATUS_PLAYER_DISABLED);
|
||||
else
|
||||
@ -3833,9 +3833,9 @@ CPed::SetBeingDraggedFromCar(CVehicle *veh, uint32 vehEnterType, bool quickJack)
|
||||
SetRadioStation();
|
||||
|
||||
if(veh->IsBike())
|
||||
veh->m_nGettingOutFlags |= GetBikeDoorFlagInclJumpInFromFront(m_vehEnterType);
|
||||
veh->m_nGettingOutFlags |= GetBikeDoorFlagInclJumpInFromFront(m_vehDoor);
|
||||
else
|
||||
veh->m_nGettingOutFlags |= GetCarDoorFlag(m_vehEnterType);
|
||||
veh->m_nGettingOutFlags |= GetCarDoorFlag(m_vehDoor);
|
||||
}
|
||||
|
||||
// --MIAMI: Done
|
||||
@ -3854,15 +3854,15 @@ CPed::BeingDraggedFromCar(void)
|
||||
assocGroup = ((CBike*)m_pMyVehicle)->m_bikeAnimType;
|
||||
|
||||
} else {
|
||||
if (m_vehEnterType == CAR_DOOR_LF || m_vehEnterType == CAR_DOOR_LR) {
|
||||
if (bWillBeQuickJacked && m_vehEnterType == CAR_DOOR_LF) {
|
||||
if (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR) {
|
||||
if (bWillBeQuickJacked && m_vehDoor == CAR_DOOR_LF) {
|
||||
enterAnim = ANIM_CAR_QJACKED;
|
||||
} else if (m_pMyVehicle->bLowVehicle) {
|
||||
enterAnim = ANIM_CAR_LJACKED_LHS;
|
||||
} else {
|
||||
enterAnim = ANIM_CAR_JACKED_LHS;
|
||||
}
|
||||
} else if (m_vehEnterType == CAR_DOOR_RF || m_vehEnterType == CAR_DOOR_RR) {
|
||||
} else if (m_vehDoor == CAR_DOOR_RF || m_vehDoor == CAR_DOOR_RR) {
|
||||
if (m_pMyVehicle->bLowVehicle)
|
||||
enterAnim = ANIM_CAR_LJACKED_RHS;
|
||||
else
|
||||
@ -3899,7 +3899,7 @@ CPed::BeingDraggedFromCar(void)
|
||||
static float mult = 5.f;
|
||||
if (m_objective == OBJECTIVE_LEAVE_CAR_AND_DIE) {
|
||||
if (m_pMyVehicle) {
|
||||
m_pMyVehicle->ProcessOpenDoor(m_vehEnterType, NUM_STD_ANIMS, m_pVehicleAnim->currentTime * mult);
|
||||
m_pMyVehicle->ProcessOpenDoor(m_vehDoor, NUM_STD_ANIMS, m_pVehicleAnim->currentTime * mult);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3915,7 +3915,7 @@ CPed::SetEnterCar(CVehicle *car, uint32 unused)
|
||||
uint8 doorFlag;
|
||||
eDoors door;
|
||||
if (car->IsBike()) {
|
||||
switch (m_vehEnterType) {
|
||||
switch (m_vehDoor) {
|
||||
case CAR_DOOR_RF:
|
||||
doorFlag = CAR_DOOR_FLAG_RF | CAR_DOOR_FLAG_LF;
|
||||
door = DOOR_FRONT_RIGHT;
|
||||
@ -3941,7 +3941,7 @@ CPed::SetEnterCar(CVehicle *car, uint32 unused)
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (m_vehEnterType) {
|
||||
switch (m_vehDoor) {
|
||||
case CAR_DOOR_RF:
|
||||
doorFlag = CAR_DOOR_FLAG_RF;
|
||||
door = DOOR_FRONT_RIGHT;
|
||||
@ -3977,7 +3977,7 @@ CPed::SetEnterCar(CVehicle *car, uint32 unused)
|
||||
|| doorFlag && !car->IsDoorReady(door) && !car->IsDoorFullyOpen(door))
|
||||
SetMoveState(PEDMOVE_STILL);
|
||||
else
|
||||
SetEnterCar_AllClear(car, m_vehEnterType, doorFlag);
|
||||
SetEnterCar_AllClear(car, m_vehDoor, doorFlag);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3993,9 +3993,9 @@ CPed::SetEnterCar_AllClear(CVehicle *car, uint32 doorNode, uint32 doorFlag)
|
||||
|
||||
m_pSeekTarget = car;
|
||||
m_pSeekTarget->RegisterReference((CEntity **) &m_pSeekTarget);
|
||||
m_vehEnterType = doorNode;
|
||||
m_vehDoor = doorNode;
|
||||
SetPedState(PED_ENTER_CAR);
|
||||
if (m_vehEnterType == CAR_DOOR_RF && m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER && !car->IsBike()) {
|
||||
if (m_vehDoor == CAR_DOOR_RF && m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER && !car->IsBike()) {
|
||||
car->bIsBeingCarJacked = true;
|
||||
}
|
||||
|
||||
@ -4003,7 +4003,7 @@ CPed::SetEnterCar_AllClear(CVehicle *car, uint32 doorNode, uint32 doorFlag)
|
||||
m_pMyVehicle->RegisterReference((CEntity**) &m_pMyVehicle);
|
||||
((CVehicle*)m_pSeekTarget)->m_nNumGettingIn++;
|
||||
bUsesCollision = false;
|
||||
CVector doorOpenPos = GetPositionToOpenCarDoor(car, m_vehEnterType);
|
||||
CVector doorOpenPos = GetPositionToOpenCarDoor(car, m_vehDoor);
|
||||
|
||||
// Because buses have stairs
|
||||
if (!m_pMyVehicle->bIsBus)
|
||||
@ -4026,7 +4026,7 @@ CPed::SetEnterCar_AllClear(CVehicle *car, uint32 doorNode, uint32 doorFlag)
|
||||
car->AutoPilot.m_nCruiseSpeed = 0;
|
||||
|
||||
} else {
|
||||
if (m_vehEnterType == CAR_DOOR_LF || m_vehEnterType == CAR_DOOR_LR)
|
||||
if (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR)
|
||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, zDiff > 4.4f ? ANIM_CAR_ALIGNHI_RHS : ANIM_CAR_ALIGN_RHS, 4.0f);
|
||||
else
|
||||
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, zDiff > 4.4f ? ANIM_CAR_ALIGNHI_LHS : ANIM_CAR_ALIGN_LHS, 4.0f);
|
||||
@ -4042,11 +4042,11 @@ CPed::EnterCar(void)
|
||||
CVehicle *veh = m_pMyVehicle;
|
||||
|
||||
// Not used.
|
||||
// CVector posForDoor = GetPositionToOpenCarDoor(veh, m_vehEnterType);
|
||||
// CVector posForDoor = GetPositionToOpenCarDoor(veh, m_vehDoor);
|
||||
|
||||
if (veh->CanPedOpenLocks(this)) {
|
||||
if (m_vehEnterType && m_pVehicleAnim) {
|
||||
veh->ProcessOpenDoor(m_vehEnterType, m_pVehicleAnim->animId, m_pVehicleAnim->currentTime);
|
||||
if (m_vehDoor && m_pVehicleAnim) {
|
||||
veh->ProcessOpenDoor(m_vehDoor, m_pVehicleAnim->animId, m_pVehicleAnim->currentTime);
|
||||
}
|
||||
}
|
||||
bIsInTheAir = false;
|
||||
@ -4102,10 +4102,10 @@ CPed::QuitEnteringCar(void)
|
||||
RestorePreviousObjective();
|
||||
|
||||
if (veh->IsBike()) {
|
||||
veh->m_nGettingInFlags &= ~GetBikeDoorFlag(m_vehEnterType);
|
||||
veh->m_nGettingInFlags &= ~GetBikeDoorFlag(m_vehDoor);
|
||||
((CBike*)veh)->bIsBeingPickedUp = false;
|
||||
} else
|
||||
veh->m_nGettingInFlags &= ~GetEnterCarDoorFlag(m_vehEnterType, veh->m_nNumMaxPassengers);
|
||||
veh->m_nGettingInFlags &= ~GetEnterCarDoorFlag(m_vehDoor, veh->m_nNumMaxPassengers);
|
||||
}
|
||||
|
||||
bUsesCollision = true;
|
||||
@ -4139,7 +4139,7 @@ CPed::SetExitBoat(CVehicle *boat)
|
||||
newPos = { 0.0f, 0.0f, boatCol->boundingBox.min.z };
|
||||
newPos = boat->GetMatrix() * newPos;
|
||||
newPos.z += 1.0f;
|
||||
m_vehEnterType = CAR_DOOR_RF;
|
||||
m_vehDoor = CAR_DOOR_RF;
|
||||
PedSetOutCarCB(nil, this);
|
||||
bIsStanding = true;
|
||||
m_pCurSurface = boat;
|
||||
@ -4148,7 +4148,7 @@ CPed::SetExitBoat(CVehicle *boat)
|
||||
} else {
|
||||
if (boat->m_modelIndex == MI_SKIMMER) {
|
||||
if (!boat->bIsInWater) {
|
||||
m_vehEnterType = CAR_DOOR_RF;
|
||||
m_vehDoor = CAR_DOOR_RF;
|
||||
PedSetOutCarCB(nil, this);
|
||||
bIsStanding = true;
|
||||
SetMoveState(PEDMOVE_STILL);
|
||||
@ -4169,7 +4169,7 @@ CPed::SetExitBoat(CVehicle *boat)
|
||||
|
||||
newPos.z += 2.0f;
|
||||
}
|
||||
m_vehEnterType = CAR_DOOR_RF;
|
||||
m_vehDoor = CAR_DOOR_RF;
|
||||
PedSetOutCarCB(nil, this);
|
||||
bIsStanding = true;
|
||||
m_pCurSurface = boat;
|
||||
@ -4410,14 +4410,14 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
|
||||
|
||||
// needed for PositionPedOutOfCollision()
|
||||
optedDoorNode = firstOptedDoor;
|
||||
m_vehEnterType = firstOptedDoor;
|
||||
m_vehDoor = firstOptedDoor;
|
||||
PositionPedOutOfCollision();
|
||||
teleportNeeded = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!teleportNeeded && veh->IsOnItsSide()) {
|
||||
m_vehEnterType = optedDoorNode;
|
||||
m_vehDoor = optedDoorNode;
|
||||
PositionPedOutOfCollision();
|
||||
teleportNeeded = true;
|
||||
}
|
||||
@ -4435,7 +4435,7 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
|
||||
bUsesCollision = false;
|
||||
m_pSeekTarget = veh;
|
||||
m_pSeekTarget->RegisterReference((CEntity**) &m_pSeekTarget);
|
||||
m_vehEnterType = optedDoorNode;
|
||||
m_vehDoor = optedDoorNode;
|
||||
SetPedState(PED_EXIT_CAR);
|
||||
if (m_pVehicleAnim && m_pVehicleAnim->flags & ASSOC_PARTIAL)
|
||||
m_pVehicleAnim->blendDelta = -1000.0f;
|
||||
@ -4448,16 +4448,16 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
|
||||
PedSetOutCarCB(nil, this);
|
||||
} else {
|
||||
if (veh->GetUp().z <= -0.8f && !veh->IsBike()) {
|
||||
if (m_vehEnterType == CAR_DOOR_RF || m_vehEnterType == CAR_DOOR_RR) {
|
||||
if (m_vehDoor == CAR_DOOR_RF || m_vehDoor == CAR_DOOR_RR) {
|
||||
m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_CRAWLOUT_RHS2);
|
||||
} else if (m_vehEnterType == CAR_DOOR_LF || m_vehEnterType == CAR_DOOR_LR) {
|
||||
} else if (m_vehDoor == CAR_DOOR_LF || m_vehDoor == CAR_DOOR_LR) {
|
||||
m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_CRAWLOUT_RHS);
|
||||
}
|
||||
m_pVehicleAnim->SetFinishCallback(PedSetOutCarCB, this);
|
||||
|
||||
} else if (veh->IsBike()) {
|
||||
CBike* bike = (CBike*)veh;
|
||||
switch (m_vehEnterType) {
|
||||
switch (m_vehDoor) {
|
||||
case CAR_BUMP_REAR:
|
||||
case CAR_BOOT:
|
||||
m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), bike->m_bikeAnimType, ANIM_BIKE_GETOFF_BACK);
|
||||
@ -4476,7 +4476,7 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
|
||||
int8 exitFlags = 0;
|
||||
|
||||
// Bike door flags incl. passenger jump off
|
||||
switch (m_vehEnterType) {
|
||||
switch (m_vehDoor) {
|
||||
case CAR_BUMP_REAR:
|
||||
case CAR_DOOR_RR:
|
||||
case CAR_DOOR_LR:
|
||||
@ -4490,7 +4490,7 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
|
||||
}
|
||||
|
||||
// Passenger get off
|
||||
if (m_vehEnterType == CAR_BUMP_REAR || m_vehEnterType == CAR_BOOT) {
|
||||
if (m_vehDoor == CAR_BUMP_REAR || m_vehDoor == CAR_BOOT) {
|
||||
m_pVehicleAnim->SetFinishCallback(RestoreHeadingRateCB, this);
|
||||
m_headingRate = 0.0f;
|
||||
|
||||
@ -4500,7 +4500,7 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
|
||||
}
|
||||
|
||||
} else {
|
||||
switch (m_vehEnterType) {
|
||||
switch (m_vehDoor) {
|
||||
case CAR_DOOR_RF:
|
||||
if (canJumpOut) {
|
||||
m_pVehicleAnim = CAnimManager::AddAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_ROLLOUT_RHS);
|
||||
@ -4551,7 +4551,7 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
|
||||
break;
|
||||
}
|
||||
if (!bBusJacked && !canJumpOut) {
|
||||
veh->m_nGettingOutFlags |= GetCarDoorFlag(m_vehEnterType);
|
||||
veh->m_nGettingOutFlags |= GetCarDoorFlag(m_vehDoor);
|
||||
}
|
||||
m_pVehicleAnim->SetFinishCallback(canJumpOut ? RestoreHeadingRateCB : PedAnimStepOutCarCB, this);
|
||||
}
|
||||
@ -4577,7 +4577,7 @@ CPed::ExitCar(void)
|
||||
if (!m_pVehicleAnim) {
|
||||
if (InVehicle()) {
|
||||
if (m_pMyVehicle->IsBike()) {
|
||||
if (m_vehEnterType == CAR_BOOT || m_vehEnterType == CAR_BUMP_REAR) {
|
||||
if (m_vehDoor == CAR_BOOT || m_vehDoor == CAR_BUMP_REAR) {
|
||||
((CBike*)m_pMyVehicle)->KnockOffRider(WEAPONTYPE_UNARMED, 0, this, false);
|
||||
}
|
||||
} else if (m_pMyVehicle->IsCar()) {
|
||||
@ -4611,7 +4611,7 @@ CPed::ExitCar(void)
|
||||
LineUpPedWithCar(LINE_UP_TO_CAR_FALL);
|
||||
}
|
||||
} else {
|
||||
m_pMyVehicle->ProcessOpenDoor(m_vehEnterType, exitAnim, animTime);
|
||||
m_pMyVehicle->ProcessOpenDoor(m_vehDoor, exitAnim, animTime);
|
||||
|
||||
if (m_pSeekTarget) {
|
||||
// Car is upside down
|
||||
@ -4673,17 +4673,17 @@ CPed::GetNearestDoor(CVehicle *veh, CVector &posToOpen)
|
||||
angleDiff += TWOPI;
|
||||
|
||||
if (Abs(angleDiff) < DEGTORAD(30.f)
|
||||
&& (IsPlayer() && ((CPlayerPed*)this)->m_fMoveSpeed > 1.5f && !m_vehEnterType ||
|
||||
&& (IsPlayer() && ((CPlayerPed*)this)->m_fMoveSpeed > 1.5f && !m_vehDoor ||
|
||||
!IsPlayer() && m_nPedType != PEDTYPE_COP && m_nMoveState == PEDMOVE_RUN
|
||||
&& m_pedStats->m_temper > 65
|
||||
&& !m_vehEnterType || m_vehEnterType == CAR_WINDSCREEN)) {
|
||||
m_vehEnterType = CAR_WINDSCREEN;
|
||||
&& !m_vehDoor || m_vehDoor == CAR_WINDSCREEN)) {
|
||||
m_vehDoor = CAR_WINDSCREEN;
|
||||
posToOpen = GetPositionToOpenCarDoor(veh, CAR_WINDSCREEN);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (m_vehEnterType == CAR_DOOR_LF && veh->pDriver && !veh->bLowVehicle && !veh->bIsBus) {
|
||||
} else if (m_vehDoor == CAR_DOOR_LF && veh->pDriver && !veh->bLowVehicle && !veh->bIsBus) {
|
||||
enterOffset = &vecPedQuickDraggedOutCarAnimOffset;
|
||||
}
|
||||
|
||||
@ -4694,10 +4694,10 @@ CPed::GetNearestDoor(CVehicle *veh, CVector &posToOpen)
|
||||
if ((lfPos - GetPosition()).MagnitudeSqr2D() < (rfPos - GetPosition()).MagnitudeSqr2D()) {
|
||||
|
||||
if (veh->IsRoomForPedToLeaveCar(CAR_DOOR_LF, enterOffset)) {
|
||||
m_vehEnterType = CAR_DOOR_LF;
|
||||
m_vehDoor = CAR_DOOR_LF;
|
||||
posToOpen = lfPos;
|
||||
} else if (veh->IsRoomForPedToLeaveCar(CAR_DOOR_RF, enterOffset)) {
|
||||
m_vehEnterType = CAR_DOOR_RF;
|
||||
m_vehDoor = CAR_DOOR_RF;
|
||||
posToOpen = rfPos;
|
||||
}
|
||||
} else {
|
||||
@ -4711,14 +4711,14 @@ CPed::GetNearestDoor(CVehicle *veh, CVector &posToOpen)
|
||||
&& veh->IsRoomForPedToLeaveCar(CAR_DOOR_LF, enterOffset)
|
||||
|| (veh->m_nGettingInFlags & CAR_DOOR_FLAG_RF) && veh->IsRoomForPedToLeaveCar(CAR_DOOR_LF, enterOffset)) {
|
||||
|
||||
m_vehEnterType = CAR_DOOR_LF;
|
||||
m_vehDoor = CAR_DOOR_LF;
|
||||
posToOpen = lfPos;
|
||||
} else {
|
||||
m_vehEnterType = CAR_DOOR_RF;
|
||||
m_vehDoor = CAR_DOOR_RF;
|
||||
posToOpen = rfPos;
|
||||
}
|
||||
} else if (veh->IsRoomForPedToLeaveCar(CAR_DOOR_LF, enterOffset)) {
|
||||
m_vehEnterType = CAR_DOOR_LF;
|
||||
m_vehDoor = CAR_DOOR_LF;
|
||||
posToOpen = lfPos;
|
||||
}
|
||||
}
|
||||
@ -4735,7 +4735,7 @@ CPed::GetNearestPassengerDoor(CVehicle *veh, CVector &posToOpen)
|
||||
|
||||
switch (veh->GetModelIndex()) {
|
||||
case MI_BUS:
|
||||
m_vehEnterType = CAR_DOOR_RF;
|
||||
m_vehDoor = CAR_DOOR_RF;
|
||||
posToOpen = GetPositionToOpenCarDoor(veh, CAR_DOOR_RF);
|
||||
return true;
|
||||
case MI_RHINO:
|
||||
@ -4794,15 +4794,15 @@ CPed::GetNearestPassengerDoor(CVehicle *veh, CVector &posToOpen)
|
||||
|
||||
CVector2D nextToCompare = rfPosDist;
|
||||
posToOpen = rfPos;
|
||||
m_vehEnterType = CAR_DOOR_RF;
|
||||
m_vehDoor = CAR_DOOR_RF;
|
||||
if (lrPosDist.MagnitudeSqr() < nextToCompare.MagnitudeSqr()) {
|
||||
m_vehEnterType = CAR_DOOR_LR;
|
||||
m_vehDoor = CAR_DOOR_LR;
|
||||
posToOpen = lrPos;
|
||||
nextToCompare = lrPosDist;
|
||||
}
|
||||
|
||||
if (rrPosDist.MagnitudeSqr() < nextToCompare.MagnitudeSqr()) {
|
||||
m_vehEnterType = CAR_DOOR_RR;
|
||||
m_vehDoor = CAR_DOOR_RR;
|
||||
posToOpen = rrPos;
|
||||
}
|
||||
return canEnter;
|
||||
@ -4825,7 +4825,7 @@ void CPed::PedSetGetInCarPositionCB(CAnimBlendAssociation* assoc, void* arg)
|
||||
CPed* pPed = (CPed*)arg;
|
||||
CMatrix mat(pPed->GetMatrix());
|
||||
CVehicle* pVehicle = pPed->m_pMyVehicle;
|
||||
const CVector& offset = (pVehicle->bIsVan && (pPed->m_vehEnterType == CAR_DOOR_RR || pPed->m_vehEnterType == CAR_DOOR_LR)) ? vecPedVanRearDoorAnimOffset : vecPedCarDoorAnimOffset;
|
||||
const CVector& offset = (pVehicle->bIsVan && (pPed->m_vehDoor == CAR_DOOR_RR || pPed->m_vehDoor == CAR_DOOR_LR)) ? vecPedVanRearDoorAnimOffset : vecPedCarDoorAnimOffset;
|
||||
CVector position = Multiply3x3(mat, offset) + pPed->GetPosition();
|
||||
CPedPlacement::FindZCoorForPed(&position);
|
||||
pPed->SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
||||
@ -5009,7 +5009,7 @@ CPed::PedSetQuickDraggedOutCarPositionCB(CAnimBlendAssociation *animAssoc, void
|
||||
ped->bUsesCollision = true;
|
||||
ped->RestartNonPartialAnims();
|
||||
draggedOutOffset = vecPedQuickDraggedOutCarAnimOffset;
|
||||
if (ped->m_vehEnterType == CAR_DOOR_RF || ped->m_vehEnterType == CAR_DOOR_RR)
|
||||
if (ped->m_vehDoor == CAR_DOOR_RF || ped->m_vehDoor == CAR_DOOR_RR)
|
||||
draggedOutOffset.x = -draggedOutOffset.x;
|
||||
|
||||
finalPos = Multiply3x3(pedMat, draggedOutOffset) + ped->GetPosition();
|
||||
@ -5022,7 +5022,7 @@ CPed::PedSetQuickDraggedOutCarPositionCB(CAnimBlendAssociation *animAssoc, void
|
||||
ped->m_fRotationCur = ped->m_fRotationDest;
|
||||
ped->CalculateNewOrientation();
|
||||
|
||||
if (!veh->IsRoomForPedToLeaveCar(ped->m_vehEnterType, &vecPedQuickDraggedOutCarAnimOffset))
|
||||
if (!veh->IsRoomForPedToLeaveCar(ped->m_vehDoor, &vecPedQuickDraggedOutCarAnimOffset))
|
||||
ped->PositionPedOutOfCollision();
|
||||
}
|
||||
|
||||
@ -5113,7 +5113,7 @@ CPed::PedSetDraggedOutCarPositionCB(CAnimBlendAssociation* animAssoc, void* arg)
|
||||
} else {
|
||||
draggedOutOffset = vecPedDraggedOutCarAnimOffset;
|
||||
}
|
||||
if (ped->m_vehEnterType == CAR_DOOR_RF || ped->m_vehEnterType == CAR_DOOR_RR)
|
||||
if (ped->m_vehDoor == CAR_DOOR_RF || ped->m_vehDoor == CAR_DOOR_RR)
|
||||
draggedOutOffset.x = -draggedOutOffset.x;
|
||||
|
||||
CVector posAfterBeingDragged = Multiply3x3(pedMat, draggedOutOffset);
|
||||
@ -5122,7 +5122,7 @@ CPed::PedSetDraggedOutCarPositionCB(CAnimBlendAssociation* animAssoc, void* arg)
|
||||
ped->m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
|
||||
ped->SetPosition(posAfterBeingDragged);
|
||||
|
||||
if (ped->m_pMyVehicle && !ped->m_pMyVehicle->IsBike() && !ped->m_pMyVehicle->IsRoomForPedToLeaveCar(ped->m_vehEnterType, &vecPedDraggedOutCarAnimOffset)) {
|
||||
if (ped->m_pMyVehicle && !ped->m_pMyVehicle->IsBike() && !ped->m_pMyVehicle->IsRoomForPedToLeaveCar(ped->m_vehDoor, &vecPedDraggedOutCarAnimOffset)) {
|
||||
ped->PositionPedOutOfCollision();
|
||||
}
|
||||
|
||||
@ -5190,7 +5190,7 @@ CPed::GetNearestTrainDoor(CVehicle *train, CVector &doorPos)
|
||||
CVehicleModelInfo* trainModel = (CVehicleModelInfo*)CModelInfo::GetModelInfo(train->m_modelIndex);
|
||||
CMatrix trainMat = CMatrix(train->GetMatrix());
|
||||
|
||||
doorPos = trainModel->m_positions[m_vehEnterType];
|
||||
doorPos = trainModel->m_positions[m_vehDoor];
|
||||
doorPos.x -= 1.5f;
|
||||
doorPos = Multiply3x3(trainMat, doorPos);
|
||||
doorPos += train->GetPosition();
|
||||
@ -5241,17 +5241,17 @@ CPed::GetNearestTrainPedPosition(CVehicle *train, CVector &enterPos)
|
||||
if (distMidEntry < distLeftEntry) {
|
||||
if (distMidEntry < distRightEntry) {
|
||||
enterPos = midEntryPos;
|
||||
m_vehEnterType = TRAIN_POS_MID_ENTRY;
|
||||
m_vehDoor = TRAIN_POS_MID_ENTRY;
|
||||
} else {
|
||||
enterPos = rightEntryPos;
|
||||
m_vehEnterType = TRAIN_POS_RIGHT_ENTRY;
|
||||
m_vehDoor = TRAIN_POS_RIGHT_ENTRY;
|
||||
}
|
||||
} else if (distRightEntry < distLeftEntry) {
|
||||
enterPos = rightEntryPos;
|
||||
m_vehEnterType = TRAIN_POS_RIGHT_ENTRY;
|
||||
m_vehDoor = TRAIN_POS_RIGHT_ENTRY;
|
||||
} else {
|
||||
enterPos = leftEntryPos;
|
||||
m_vehEnterType = TRAIN_POS_LEFT_ENTRY;
|
||||
m_vehDoor = TRAIN_POS_LEFT_ENTRY;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -6030,7 +6030,7 @@ CPed::SeekBoatPosition(void)
|
||||
m_vecSeekPos = boatMat * enterOffset;
|
||||
if (Seek()) {
|
||||
// We arrived to the boat
|
||||
m_vehEnterType = 0;
|
||||
m_vehDoor = 0;
|
||||
SetEnterCar(m_carInObjective, 0);
|
||||
}
|
||||
} else
|
||||
@ -6167,9 +6167,9 @@ CPed::PositionPedOutOfCollision(void)
|
||||
foundAPos = true;
|
||||
}
|
||||
|
||||
} else if (m_vehEnterType != 0) {
|
||||
} else if (m_vehDoor != 0) {
|
||||
// Try the normal way
|
||||
CVector pos = GetPositionToOpenCarDoor(m_pMyVehicle, m_vehEnterType);
|
||||
CVector pos = GetPositionToOpenCarDoor(m_pMyVehicle, m_vehDoor);
|
||||
newPos = pos;
|
||||
GetMatrix().SetTranslate(newPos);
|
||||
if (!CheckCollision()) {
|
||||
@ -6179,7 +6179,7 @@ CPed::PositionPedOutOfCollision(void)
|
||||
}
|
||||
|
||||
float vehRelativeExitX = vehCol->boundingBox.min.x - 0.355f;
|
||||
if (m_vehEnterType == CAR_DOOR_RF || m_vehEnterType == CAR_DOOR_RR)
|
||||
if (m_vehDoor == CAR_DOOR_RF || m_vehDoor == CAR_DOOR_RR)
|
||||
vehRelativeExitX = 0.355f + vehCol->boundingBox.max.x;
|
||||
|
||||
if (!foundAPos) {
|
||||
@ -6500,19 +6500,19 @@ CPed::KillCharOnFootArmed(CVector &ourPos, CVector &targetPos, CVector &distWith
|
||||
if (m_nPedType == PEDTYPE_COP || vehOfTarget->bIsBus) {
|
||||
GoToNearestDoor(vehOfTarget);
|
||||
} else {
|
||||
m_vehEnterType = 0;
|
||||
m_vehDoor = 0;
|
||||
if (m_pedInObjective == vehOfTarget->pDriver || vehOfTarget->bIsBus) {
|
||||
m_vehEnterType = CAR_DOOR_LF;
|
||||
m_vehDoor = CAR_DOOR_LF;
|
||||
} else if (m_pedInObjective == vehOfTarget->pPassengers[0]) {
|
||||
m_vehEnterType = CAR_DOOR_RF;
|
||||
m_vehDoor = CAR_DOOR_RF;
|
||||
} else if (m_pedInObjective == vehOfTarget->pPassengers[1]) {
|
||||
m_vehEnterType = CAR_DOOR_LR;
|
||||
m_vehDoor = CAR_DOOR_LR;
|
||||
} else if (m_pedInObjective == vehOfTarget->pPassengers[2]) {
|
||||
m_vehEnterType = CAR_DOOR_RR;
|
||||
m_vehDoor = CAR_DOOR_RR;
|
||||
}
|
||||
// Unused
|
||||
// GetPositionToOpenCarDoor(vehOfTarget, m_vehEnterType);
|
||||
SetSeekCar(vehOfTarget, m_vehEnterType);
|
||||
// GetPositionToOpenCarDoor(vehOfTarget, m_vehDoor);
|
||||
SetSeekCar(vehOfTarget, m_vehDoor);
|
||||
SetMoveState(PEDMOVE_RUN);
|
||||
}
|
||||
}
|
||||
@ -6790,19 +6790,19 @@ CPed::KillCharOnFootMelee(CVector &ourPos, CVector &targetPos, CVector &distWith
|
||||
if (m_nPedType == PEDTYPE_COP || vehOfTarget->bIsBus) {
|
||||
GoToNearestDoor(vehOfTarget);
|
||||
} else {
|
||||
m_vehEnterType = 0;
|
||||
m_vehDoor = 0;
|
||||
if (m_pedInObjective == vehOfTarget->pDriver || vehOfTarget->bIsBus) {
|
||||
m_vehEnterType = CAR_DOOR_LF;
|
||||
m_vehDoor = CAR_DOOR_LF;
|
||||
} else if (m_pedInObjective == vehOfTarget->pPassengers[0]) {
|
||||
m_vehEnterType = CAR_DOOR_RF;
|
||||
m_vehDoor = CAR_DOOR_RF;
|
||||
} else if (m_pedInObjective == vehOfTarget->pPassengers[1]) {
|
||||
m_vehEnterType = CAR_DOOR_LR;
|
||||
m_vehDoor = CAR_DOOR_LR;
|
||||
} else if (m_pedInObjective == vehOfTarget->pPassengers[2]) {
|
||||
m_vehEnterType = CAR_DOOR_RR;
|
||||
m_vehDoor = CAR_DOOR_RR;
|
||||
}
|
||||
// Unused
|
||||
// GetPositionToOpenCarDoor(vehOfTarget, m_vehEnterType);
|
||||
SetSeekCar(vehOfTarget, m_vehEnterType);
|
||||
// GetPositionToOpenCarDoor(vehOfTarget, m_vehDoor);
|
||||
SetSeekCar(vehOfTarget, m_vehDoor);
|
||||
SetMoveState(PEDMOVE_RUN);
|
||||
}
|
||||
}
|
||||
|
@ -5823,7 +5823,7 @@ CAutomobile::KnockPedOutCar(eWeaponType weapon, uint16 door, CPed *ped)
|
||||
if(ped == nil)
|
||||
return;
|
||||
|
||||
ped->m_vehEnterType = door;
|
||||
ped->m_vehDoor = door;
|
||||
ped->SetPedState(PED_IDLE);
|
||||
CAnimManager::BlendAnimation(ped->GetClump(), ped->m_animGroup, ANIM_IDLE_STANCE, 100.0f);
|
||||
CPed::PedSetOutCarCB(nil, ped);
|
||||
|
@ -2609,7 +2609,7 @@ CBike::KnockOffRider(eWeaponType weapon, uint8 direction, CPed *ped, bool bGetBa
|
||||
|
||||
ped->SetPedState(PED_IDLE);
|
||||
CAnimManager::BlendAnimation(ped->GetClump(), ped->m_animGroup, ANIM_IDLE_STANCE, 100.0f);
|
||||
ped->m_vehEnterType = CAR_DOOR_LF;
|
||||
ped->m_vehDoor = CAR_DOOR_LF;
|
||||
CPed::PedSetOutCarCB(nil, ped);
|
||||
ped->SetMoveState(PEDMOVE_STILL);
|
||||
if(GetUp().z < 0.0f)
|
||||
|
@ -388,7 +388,7 @@ void
|
||||
CTrain::AddPassenger(CPed *ped)
|
||||
{
|
||||
#ifdef GTA_TRAIN
|
||||
int i = ped->m_vehEnterType;
|
||||
int i = ped->m_vehDoor;
|
||||
if((i == TRAIN_POS_LEFT_ENTRY || i == TRAIN_POS_MID_ENTRY || i == TRAIN_POS_RIGHT_ENTRY) && pPassengers[i] == nil){
|
||||
pPassengers[i] = ped;
|
||||
m_nNumPassengers++;
|
||||
|
@ -1430,13 +1430,13 @@ CVehicle::ShufflePassengersToMakeSpace(void)
|
||||
if (!pPassengers[2] && !(m_nGettingInFlags & CAR_DOOR_FLAG_RR)) {
|
||||
pPassengers[2] = pPassengers[1];
|
||||
pPassengers[1] = nil;
|
||||
pPassengers[2]->m_vehEnterType = CAR_DOOR_RR;
|
||||
pPassengers[2]->m_vehDoor = CAR_DOOR_RR;
|
||||
return true;
|
||||
}
|
||||
if (!pPassengers[0] && !(m_nGettingInFlags & CAR_DOOR_FLAG_RF)) {
|
||||
pPassengers[0] = pPassengers[1];
|
||||
pPassengers[1] = nil;
|
||||
pPassengers[0]->m_vehEnterType = CAR_DOOR_RF;
|
||||
pPassengers[0]->m_vehDoor = CAR_DOOR_RF;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -1447,13 +1447,13 @@ CVehicle::ShufflePassengersToMakeSpace(void)
|
||||
if (!pPassengers[1] && !(m_nGettingInFlags & CAR_DOOR_FLAG_LR)) {
|
||||
pPassengers[1] = pPassengers[2];
|
||||
pPassengers[2] = nil;
|
||||
pPassengers[1]->m_vehEnterType = CAR_DOOR_LR;
|
||||
pPassengers[1]->m_vehDoor = CAR_DOOR_LR;
|
||||
return true;
|
||||
}
|
||||
if (!pPassengers[0] && !(m_nGettingInFlags & CAR_DOOR_FLAG_RF)) {
|
||||
pPassengers[0] = pPassengers[2];
|
||||
pPassengers[2] = nil;
|
||||
pPassengers[0]->m_vehEnterType = CAR_DOOR_RF;
|
||||
pPassengers[0]->m_vehDoor = CAR_DOOR_RF;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -1464,13 +1464,13 @@ CVehicle::ShufflePassengersToMakeSpace(void)
|
||||
if (!pPassengers[1] && !(m_nGettingInFlags & CAR_DOOR_FLAG_LR)) {
|
||||
pPassengers[1] = pPassengers[0];
|
||||
pPassengers[0] = nil;
|
||||
pPassengers[1]->m_vehEnterType = CAR_DOOR_LR;
|
||||
pPassengers[1]->m_vehDoor = CAR_DOOR_LR;
|
||||
return true;
|
||||
}
|
||||
if (!pPassengers[2] && !(m_nGettingInFlags & CAR_DOOR_FLAG_RR)) {
|
||||
pPassengers[2] = pPassengers[0];
|
||||
pPassengers[0] = nil;
|
||||
pPassengers[2]->m_vehEnterType = CAR_DOOR_RR;
|
||||
pPassengers[2]->m_vehDoor = CAR_DOOR_RR;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user