summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
Diffstat (limited to 'src/peds')
-rw-r--r--src/peds/Ped.cpp33
-rw-r--r--src/peds/Ped.h3
2 files changed, 20 insertions, 16 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 8f6cc284..691b5195 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -66,7 +66,7 @@
CPed *gapTempPedList[50];
uint16 gnNumTempPedList;
-CColPoint aTempPedColPts[MAX_COLLISION_POINTS];
+static CColPoint aTempPedColPts[MAX_COLLISION_POINTS];
// TODO(Miami)
#define AUDIO_NOT_READY
@@ -2413,7 +2413,7 @@ particleProduceFootDust(CPed *ped, CVector const &pos, float size, int times)
switch (ped->m_nSurfaceTouched)
{
case SURFACE_TARMAC:
- case SURFACE_DIRT:
+ case SURFACE_GRAVEL:
case SURFACE_PAVEMENT:
case SURFACE_SAND:
for (int i = 0; i < times; ++i) {
@@ -2566,7 +2566,7 @@ CPed::PlayFootSteps(void)
}
}
- if (m_nSurfaceTouched == SURFACE_PUDDLE) {
+ if (m_nSurfaceTouched == SURFACE_WATER) {
float pedSpeed = CVector2D(m_vecMoveSpeed).Magnitude();
if (pedSpeed > 0.03f && CTimer::GetFrameCounter() % 2 == 0 && pedSpeed > 0.13f) {
#ifdef PC_PARTICLE
@@ -2965,7 +2965,7 @@ CPed::CanPedDriveOff(void)
bool
CPed::CanPedJumpThis(CEntity *unused, CVector *damageNormal = nil)
{
- if (m_nSurfaceTouched == SURFACE_PUDDLE)
+ if (m_nSurfaceTouched == SURFACE_WATER)
return true;
CVector pos = GetPosition();
@@ -4558,7 +4558,8 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
m_pMyVehicle->AutoPilot.m_nTempAction = TEMPACT_HANDBRAKESTRAIGHT;
m_pMyVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 2000;
}
- if (m_pMyVehicle->CanPedExitCar()) {
+// TODO(MIAMI): argument
+ if (m_pMyVehicle->CanPedExitCar(false)) {
SetObjective(OBJECTIVE_LEAVE_CAR_AND_DIE, m_pMyVehicle);
} else {
m_fHealth = 0.0f;
@@ -5305,8 +5306,8 @@ CPed::SetAttack(CEntity *victim)
aimPos += GetUp() * 0.35f;
CEntity *obstacle = CWorld::TestSphereAgainstWorld(aimPos, 0.2f, nil, true, false, false, true, false, false);
if (obstacle) {
- if(gaTempSphereColPoints[0].surfaceB != SURFACE_SCAFFOLD && gaTempSphereColPoints[0].surfaceB != SURFACE_METAL_FENCE &&
- gaTempSphereColPoints[0].surfaceB != SURFACE_WOOD_BOX && gaTempSphereColPoints[0].surfaceB != SURFACE_METAL_POLE) {
+ if(gaTempSphereColPoints[0].surfaceB != SURFACE_TRANSPARENT_CLOTH && gaTempSphereColPoints[0].surfaceB != SURFACE_METAL_CHAIN_FENCE &&
+ gaTempSphereColPoints[0].surfaceB != SURFACE_WOOD_BENCH && gaTempSphereColPoints[0].surfaceB != SURFACE_SCAFFOLD_POLE) {
if (!IsPlayer()) {
bObstacleShowedUpDuringKillObjective = true;
m_shootTimer = 0;
@@ -11646,7 +11647,7 @@ CPed::SetJump(void)
#ifdef VC_PED_PORTS
m_nPedState != PED_JUMP && !RpAnimBlendClumpGetAssociation(GetClump(), ANIM_JUMP_LAUNCH) &&
#endif
- (m_nSurfaceTouched != SURFACE_STONE || DotProduct(GetForward(), m_vecDamageNormal) >= 0.0f)) {
+ (m_nSurfaceTouched != SURFACE_STEEP_CLIFF || DotProduct(GetForward(), m_vecDamageNormal) >= 0.0f)) {
SetStoredState();
m_nPedState = PED_JUMP;
CAnimBlendAssociation *jumpAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_JUMP_LAUNCH, 8.0f);
@@ -13372,7 +13373,8 @@ CPed::ProcessObjective(void)
} else {
bool targetHasVeh = m_pedInObjective->bInVehicle;
if (!targetHasVeh
- || targetHasVeh && m_pedInObjective->m_pMyVehicle->CanPedExitCar()) {
+// TODO(MIAMI): argument
+ || targetHasVeh && m_pedInObjective->m_pMyVehicle->CanPedExitCar(false)) {
m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 0;
m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
SetObjective(OBJECTIVE_LEAVE_VEHICLE, m_pMyVehicle);
@@ -15427,13 +15429,13 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
}
float minDist = 1.0f;
belowTorsoCollided = CCollision::ProcessVerticalLine(ourLine, collidingEnt->GetMatrix(), *hisCol,
- intersectionPoint, minDist, false, &m_collPoly);
+ intersectionPoint, minDist, false, false, &m_collPoly);
if (collidedWithBoat && bWasStanding && !belowTorsoCollided) {
ourLine.p0.z = ourLine.p1.z;
ourLine.p1.z = ourLine.p1.z + gravityEffect;
belowTorsoCollided = CCollision::ProcessVerticalLine(ourLine, collidingEnt->GetMatrix(), *hisCol,
- intersectionPoint, minDist, false, &m_collPoly);
+ intersectionPoint, minDist, false, false, &m_collPoly);
}
if (belowTorsoCollided) {
#ifndef VC_PED_PORTS
@@ -15471,7 +15473,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
GetMatrix().GetPosition().z = FEET_OFFSET + intersectionPoint.point.z;
#endif
m_nSurfaceTouched = intersectionPoint.surfaceB;
- if (m_nSurfaceTouched == SURFACE_STONE) {
+ if (m_nSurfaceTouched == SURFACE_STEEP_CLIFF) {
bHitSteepSlope = true;
m_vecDamageNormal = intersectionPoint.normal;
}
@@ -15557,7 +15559,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
#endif
sphereNormal.Normalise();
collidingPoints[sphere].normal = sphereNormal;
- if (collidingPoints[sphere].surfaceB == SURFACE_STONE)
+ if (collidingPoints[sphere].surfaceB == SURFACE_STEEP_CLIFF)
bHitSteepSlope = true;
}
}
@@ -16151,7 +16153,8 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
uint32 optedDoorNode = wantedDoorNode;
bool teleportNeeded = false;
bool isLow = !!veh->bLowVehicle;
- if (!veh->CanPedExitCar()) {
+// TODO(MIAMI): argument
+ if (!veh->CanPedExitCar(false)) {
if (veh->pDriver && !veh->pDriver->IsPlayer()) {
veh->AutoPilot.m_nCruiseSpeed = 0;
veh->AutoPilot.m_nCarMission = MISSION_NONE;
@@ -17427,7 +17430,7 @@ CPed::UpdatePosition(void)
velocityChange = m_moved + velocityOfSurface - m_vecMoveSpeed;
m_fRotationCur += curSurface->m_vecTurnSpeed.z * CTimer::GetTimeStep();
m_fRotationDest += curSurface->m_vecTurnSpeed.z * CTimer::GetTimeStep();
- } else if (m_nSurfaceTouched != SURFACE_STONE || m_vecDamageNormal.x == 0.0f && m_vecDamageNormal.y == 0.0f) {
+ } else if (m_nSurfaceTouched != SURFACE_STEEP_CLIFF || m_vecDamageNormal.x == 0.0f && m_vecDamageNormal.y == 0.0f) {
velocityChange = m_moved - m_vecMoveSpeed;
} else {
// Ped got damaged by steep slope
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index 776aa1dd..155e6cea 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -447,7 +447,7 @@ public:
uint32 bIsDrowning : 1;
uint32 bDrownsInWater : 1;
//uint32 b156_4
- //uint32 b156_8
+ uint32 b156_8 : 1;
uint32 bIsPlayerFriend : 1;
#ifdef VC_PED_PORTS
uint32 bHeadStuckInCollision : 1;
@@ -864,6 +864,7 @@ public:
static void PedSetDraggedOutCarPositionCB(CAnimBlendAssociation *assoc, void *arg);
bool IsPlayer(void);
+ bool IsFemale(void) { return m_nPedType == PEDTYPE_CIVFEMALE || m_nPedType == PEDTYPE_PROSTITUTE; }
bool UseGroundColModel(void);
bool CanSetPedState(void);
bool IsPedInControl(void);