summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/animation/AnimBlendAssociation.h2
-rw-r--r--src/animation/AnimManager.cpp2
-rw-r--r--src/entities/Ped.cpp34
-rw-r--r--src/entities/Vehicle.h7
4 files changed, 19 insertions, 26 deletions
diff --git a/src/animation/AnimBlendAssociation.h b/src/animation/AnimBlendAssociation.h
index d846a4d3..a7e127f7 100644
--- a/src/animation/AnimBlendAssociation.h
+++ b/src/animation/AnimBlendAssociation.h
@@ -77,7 +77,7 @@ public:
void UpdateTime(float timeDelta, float relSpeed);
bool UpdateBlend(float timeDelta);
- float GetTimeLeft() { return hierarchy->totalLength - currentTime; }
+ inline float GetTimeLeft() { return hierarchy->totalLength - currentTime; }
static CAnimBlendAssociation *FromLink(CAnimBlendLink *l) {
return (CAnimBlendAssociation*)((uint8*)l - offsetof(CAnimBlendAssociation, link));
diff --git a/src/animation/AnimManager.cpp b/src/animation/AnimManager.cpp
index 73fc4d94..6ad63e49 100644
--- a/src/animation/AnimManager.cpp
+++ b/src/animation/AnimManager.cpp
@@ -752,7 +752,7 @@ CAnimManager::LoadAnimFiles(void)
AnimAssocDefinition *def = &CAnimManager::ms_aAnimAssocDefinitions[i];
group->CreateAssociations(def->blockName, clump, def->animNames, def->numAnims);
for(j = 0; j < group->numAssociations; j++)
- group->GetAnimation(def->animDescs[j].animId)->flags |= def->animDescs[j].flags;
+ group->GetAnimation(j)->flags |= def->animDescs[j].flags;
RpClumpDestroy(clump);
}
}
diff --git a/src/entities/Ped.cpp b/src/entities/Ped.cpp
index ba0e3088..055ea3fb 100644
--- a/src/entities/Ped.cpp
+++ b/src/entities/Ped.cpp
@@ -558,11 +558,11 @@ CheckForPedsOnGroundToAttack(CPlayerPed *player, CPed **pedOnGround)
if (currentPedState == PED_DEAD) {
foundDead = 1;
if (!deadPed)
- deadPed = (CPed*)currentPed;
+ deadPed = currentPed;
} else if (!currentPed->IsPedHeadAbovePos(-0.6f)) {
foundOnTheFloor = 1;
if (!pedOnTheFloor)
- pedOnTheFloor = (CPed*)currentPed;
+ pedOnTheFloor = currentPed;
}
}
} else if ((distance >= 0.8f || angleDiff >= DEGTORAD(75.0f))
@@ -573,11 +573,11 @@ CheckForPedsOnGroundToAttack(CPlayerPed *player, CPed **pedOnGround)
if (angleDiff < DEGTORAD(75.0f)) {
foundBelow = 1;
if (!pedBelow)
- pedBelow = (CPed*)currentPed;
+ pedBelow = currentPed;
}
} else {
foundBelow = 1;
- pedBelow = (CPed*)currentPed;
+ pedBelow = currentPed;
break;
}
}
@@ -598,7 +598,7 @@ CheckForPedsOnGroundToAttack(CPlayerPed *player, CPed **pedOnGround)
}
if (pedOnGround)
- * pedOnGround = (CPed*)currentPed;
+ * pedOnGround = currentPed;
return stateToReturn;
}
@@ -1370,7 +1370,7 @@ CPed::RestartNonPartialAnims(void)
{
CAnimBlendAssociation *assoc;
- for (assoc = RpAnimBlendClumpGetFirstAssociation((RpClump*)m_rwObject); !assoc; assoc = RpAnimBlendGetNextAssociation(assoc)) {
+ for (assoc = RpAnimBlendClumpGetFirstAssociation((RpClump*)m_rwObject); assoc; assoc = RpAnimBlendGetNextAssociation(assoc)) {
if (!assoc->IsPartial())
assoc->flags |= ASSOC_RUNNING;
}
@@ -1680,7 +1680,7 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
float pedZSpeedOnExit = m_vecMoveSpeed.z - 0.008f * CTimer::GetTimeStep();
// If we're not in ground at next step, apply animation
- if (neededPos.z + pedZSpeedOnExit > autoZPos.z) {
+ if (neededPos.z + pedZSpeedOnExit >= autoZPos.z) {
m_vecMoveSpeed.z = pedZSpeedOnExit;
ApplyMoveSpeed();
// Removing below line breaks the animation
@@ -1742,9 +1742,9 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
neededPos -= timeUntilStateChange * m_vecOffsetSeek;
}
- if (limitedAngle >= PI + m_fRotationCur) {
+ if (limitedAngle > PI + m_fRotationCur) {
limitedAngle -= 2 * PI;
- } else if (limitedAngle <= m_fRotationCur - PI) {
+ } else if (limitedAngle < m_fRotationCur - PI) {
limitedAngle += 2 * PI;
}
m_fRotationCur -= (m_fRotationCur - limitedAngle) * (1.0f - timeUntilStateChange);
@@ -2376,7 +2376,7 @@ CPed::SetLeader(CEntity *leader)
m_leader = (CPed*)leader;
if(m_leader)
- m_leader->RegisterReference((CEntity **)m_leader);
+ m_leader->RegisterReference((CEntity **)&m_leader);
}
void
@@ -2458,9 +2458,9 @@ CPed::SetObjective(eObjective newObj, void *entity)
m_ped_flagD20 = false;
m_vecSeekVehicle = CVector(0.0f, 0.0f, 0.0f);
m_pedInObjective = (CPed*)entity;
- m_pedInObjective->RegisterReference((CEntity**)m_pedInObjective);
+ m_pedInObjective->RegisterReference((CEntity**)&m_pedInObjective);
m_pLookTarget = (CEntity*)entity;
- m_pLookTarget->RegisterReference((CEntity**)m_pLookTarget);
+ m_pLookTarget->RegisterReference((CEntity**)&m_pLookTarget);
return;
case OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE:
case OBJECTIVE_FLEE_CHAR_ON_FOOT_ALWAYS:
@@ -2468,17 +2468,17 @@ CPed::SetObjective(eObjective newObj, void *entity)
case OBJECTIVE_FIGHT_CHAR:
m_vecSeekVehicle = CVector(0.0f, 0.0f, 0.0f);
m_pedInObjective = (CPed*)entity;
- m_pedInObjective->RegisterReference((CEntity**)m_pedInObjective);
+ m_pedInObjective->RegisterReference((CEntity**)&m_pedInObjective);
return;
case OBJECTIVE_FOLLOW_PED_IN_FORMATION:
m_pedInObjective = (CPed*)entity;
- m_pedInObjective->RegisterReference((CEntity**)m_pedInObjective);
+ m_pedInObjective->RegisterReference((CEntity**)&m_pedInObjective);
m_pedFormation = 1;
return;
case OBJECTIVE_LEAVE_VEHICLE:
case OBJECTIVE_FLEE_CAR:
m_carInObjective = (CVehicle*)entity;
- m_carInObjective->RegisterReference((CEntity **)m_carInObjective);
+ m_carInObjective->RegisterReference((CEntity **)&m_carInObjective);
if (!m_carInObjective->bIsBus || m_leaveCarTimer)
return;
break;
@@ -2496,9 +2496,9 @@ CPed::SetObjective(eObjective newObj, void *entity)
case OBJECTIVE_SOLICIT:
case OBJECTIVE_BUY_ICE_CREAM:
m_carInObjective = (CVehicle*)entity;
- m_carInObjective->RegisterReference((CEntity**)m_carInObjective);
+ m_carInObjective->RegisterReference((CEntity**)&m_carInObjective);
m_pSeekTarget = m_carInObjective;
- m_pSeekTarget->RegisterReference((CEntity**)m_pSeekTarget);
+ m_pSeekTarget->RegisterReference((CEntity**)&m_pSeekTarget);
m_vecSeekVehicle = CVector(0.0f, 0.0f, 0.0f);
if (newObj == OBJECTIVE_SOLICIT) {
m_objectiveTimer = CTimer::GetTimeInMilliseconds() + 10000;
diff --git a/src/entities/Vehicle.h b/src/entities/Vehicle.h
index 7b9bebef..39a56fe0 100644
--- a/src/entities/Vehicle.h
+++ b/src/entities/Vehicle.h
@@ -69,13 +69,6 @@ enum eDoors
DOOR_REAR_RIGHT
};
-enum {
- GETTING_IN_OUT_FL = 1,
- GETTING_IN_OUT_RL = 2,
- GETTING_IN_OUT_FR = 4,
- GETTING_IN_OUT_RR = 8
-};
-
class CVehicle : public CPhysical
{
public: