aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-07-03 01:32:47 +0300
committererorcun <erorcunerorcun@hotmail.com.tr>2021-07-03 02:57:32 +0300
commit1c0878f65b8a554bdea9183fdc4b76645e530ccb (patch)
treebe7f69e8d0ea407134f8fed85d1acc3c70b59ed1 /src
parent43631ba2036492821ecaa0f3c5d56795a310bfd2 (diff)
Sanitizer fixes 2
Diffstat (limited to 'src')
-rw-r--r--src/core/Crime.h2
-rw-r--r--src/peds/Ped.cpp25
-rw-r--r--src/peds/Ped.h2
3 files changed, 15 insertions, 14 deletions
diff --git a/src/core/Crime.h b/src/core/Crime.h
index 3c3e2b26..4c7ea315 100644
--- a/src/core/Crime.h
+++ b/src/core/Crime.h
@@ -28,7 +28,7 @@ class CCrimeBeingQd
{
public:
eCrimeType m_nType;
- uint32 m_nId;
+ int32 m_nId;
uint32 m_nTime;
CVector m_vecPosn;
bool m_bReported;
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 96f3479c..44712fa0 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -2887,7 +2887,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
CColModel *hisCol = CModelInfo::GetModelInfo(collidingEnt->GetModelIndex())->GetColModel();
if (!bUsesCollision && !bJustCheckCollision)
- return false;
+ return 0;
if (collidingEnt->IsVehicle() && ((CVehicle*)collidingEnt)->IsBoat())
collidedWithBoat = true;
@@ -6775,7 +6775,7 @@ CPed::FollowPath(void)
}
void
-CPed::SetEvasiveStep(CEntity *reason, uint8 animType)
+CPed::SetEvasiveStep(CPhysical *reason, uint8 animType)
{
AnimationId stepAnim;
@@ -6793,22 +6793,23 @@ CPed::SetEvasiveStep(CEntity *reason, uint8 animType)
if (neededTurn > PI)
neededTurn = TWOPI - neededTurn;
- CVehicle *veh = (CVehicle*)reason;
- if (reason->IsVehicle() && veh->IsCar()) {
+ if (reason->IsVehicle() && ((CVehicle*)reason)->IsCar()) {
+ CVehicle *veh = (CVehicle*)reason;
if (veh->m_nCarHornTimer != 0) {
vehPressedHorn = true;
if (!IsPlayer())
animType = 1;
}
}
- if (neededTurn <= DEGTORAD(90.0f) || veh->GetModelIndex() == MI_RCBANDIT || vehPressedHorn || animType != 0) {
- SetLookFlag(veh, true);
- if ((CGeneral::GetRandomNumber() & 1) && veh->GetModelIndex() != MI_RCBANDIT && animType == 0) {
+
+ if (neededTurn <= DEGTORAD(90.0f) || reason->GetModelIndex() == MI_RCBANDIT || vehPressedHorn || animType != 0) {
+ SetLookFlag(reason, true);
+ if ((CGeneral::GetRandomNumber() & 1) && reason->GetModelIndex() != MI_RCBANDIT && animType == 0) {
stepAnim = ANIM_STD_HAILTAXI;
} else {
- float vehDirection = CGeneral::GetRadianAngleBetweenPoints(
- veh->m_vecMoveSpeed.x, veh->m_vecMoveSpeed.y,
+ float dangerDirection = CGeneral::GetRadianAngleBetweenPoints(
+ reason->m_vecMoveSpeed.x, reason->m_vecMoveSpeed.y,
0.0f, 0.0f);
// Let's turn our back to the "reason"
@@ -6818,14 +6819,14 @@ CPed::SetEvasiveStep(CEntity *reason, uint8 animType)
angleToFace -= TWOPI;
// We don't want to run towards car's direction
- float dangerZone = angleToFace - vehDirection;
+ float dangerZone = angleToFace - dangerDirection;
dangerZone = CGeneral::LimitRadianAngle(dangerZone);
// So, add or subtract 90deg (jump to left/right) according to that
if (dangerZone > 0.0f)
- angleToFace = vehDirection - HALFPI;
+ angleToFace = dangerDirection - HALFPI;
else
- angleToFace = vehDirection + HALFPI;
+ angleToFace = dangerDirection + HALFPI;
stepAnim = ANIM_STD_NUM;
if (animType == 0 || animType == 1)
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index c5c6cf49..f5a7d7dc 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -762,7 +762,7 @@ public:
void SetAimFlag(CEntity* to);
void SetAimFlag(float angle);
void SetAmmo(eWeaponType weaponType, uint32 ammo);
- void SetEvasiveStep(CEntity*, uint8);
+ void SetEvasiveStep(CPhysical*, uint8);
void GrantAmmo(eWeaponType, uint32);
void SetEvasiveDive(CPhysical*, uint8);
void SetAttack(CEntity*);