diff options
Diffstat (limited to '')
-rw-r--r-- | src/entities/Object.cpp | 4 | ||||
-rw-r--r-- | src/entities/Object.h | 21 | ||||
-rw-r--r-- | src/entities/Ped.h | 2 | ||||
-rw-r--r-- | src/entities/Physical.cpp | 8 | ||||
-rw-r--r-- | src/entities/Physical.h | 2 |
5 files changed, 26 insertions, 11 deletions
diff --git a/src/entities/Object.cpp b/src/entities/Object.cpp index 2b068d49..35a64604 100644 --- a/src/entities/Object.cpp +++ b/src/entities/Object.cpp @@ -16,8 +16,8 @@ CObject::CObject(void) m_type = ENTITY_TYPE_OBJECT; m_fUprootLimit = 0.0f; m_nCollisionDamageEffect = 0; - m_bSpecialCollisionResponseCases = 0; - m_bCameraToAvoidThisObject = 0; + m_nSpecialCollisionResponseCases = COLLRESPONSE_NONE; + m_bCameraToAvoidThisObject = false; ObjectCreatedBy = 0; m_nEndOfLifeTime = 0; // m_nRefModelIndex = -1; // duplicate diff --git a/src/entities/Object.h b/src/entities/Object.h index c9800e20..2079ff0e 100644 --- a/src/entities/Object.h +++ b/src/entities/Object.h @@ -9,6 +9,21 @@ enum { CUTSCENE_OBJECT = 4, }; +enum { + COLLRESPONSE_NONE, + COLLRESPONSE_CHANGE_MODEL, + COLLRESPONSE_SPLIT_MODEL, + COLLRESPONSE_SMASH_COMPLETELY, + COLLRESPONSE_CHANGE_THEN_SMASH, + COLLRESPONSE_UNKNOWN5, + + COLLRESPONSE_SMASH_CARDBOARD_COMPLETELY = 50, + COLLRESPONSE_SMASH_WOODENBOX_COMPLETELY = 60, + COLLRESPONSE_SMASH_TRAFFICCONE_COMPLETELY = 70, + COLLRESPONSE_SMASH_BARPOST_COMPLETELY = 80, + +}; + class CVehicle; class CObject : public CPhysical @@ -28,9 +43,9 @@ public: int8 field_172; int8 field_173; float m_fCollisionDamageMultiplier; - int8 m_nCollisionDamageEffect; - int8 m_bSpecialCollisionResponseCases; - int8 m_bCameraToAvoidThisObject; + uint8 m_nCollisionDamageEffect; + uint8 m_nSpecialCollisionResponseCases; + bool m_bCameraToAvoidThisObject; int8 field_17B; int8 field_17C; int8 field_17D; diff --git a/src/entities/Ped.h b/src/entities/Ped.h index 3804236a..fbfa3f57 100644 --- a/src/entities/Ped.h +++ b/src/entities/Ped.h @@ -211,7 +211,7 @@ public: bool bInVehicle; uint8 stuff4[23]; int32 m_nPedType; - CPedStat *m_pedStats; + CPedStats *m_pedStats; uint8 stuff5[24]; CEntity *m_pCollidingEntity; uint8 stuff6[12]; diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp index 33e2deff..f2693a68 100644 --- a/src/entities/Physical.cpp +++ b/src/entities/Physical.cpp @@ -1801,8 +1801,8 @@ CPhysical::ProcessCollision(void) n = distSq > 0.32f ? NUMSTEPS(0.3f) : NUMSTEPS(0.4f); step = savedTimeStep / n; }else if(IsObject()){ - int responsecase = ((CObject*)this)->m_bSpecialCollisionResponseCases; - if(responsecase == 1){ + int responsecase = ((CObject*)this)->m_nSpecialCollisionResponseCases; + if(responsecase == COLLRESPONSE_CHANGE_MODEL){ CVector speedUp = { 0.0f, 0.0f, 0.0f }; CVector speedDown = { 0.0f, 0.0f, 0.0f }; speedUp.z = GetBoundRadius(); @@ -1816,12 +1816,12 @@ CPhysical::ProcessCollision(void) n = NUMSTEPS(0.3f); step = savedTimeStep / n; } - }else if(responsecase == 5){ + }else if(responsecase == COLLRESPONSE_UNKNOWN5){ if(distSq >= 0.009f){ n = NUMSTEPS(0.09f); step = savedTimeStep / n; } - }else if(responsecase == 2 || responsecase == 4){ + }else if(responsecase == COLLRESPONSE_SPLIT_MODEL || responsecase == COLLRESPONSE_CHANGE_THEN_SMASH){ if(distSq >= sq(0.15f)){ n = NUMSTEPS(0.15f); step = savedTimeStep / n; diff --git a/src/entities/Physical.h b/src/entities/Physical.h index 6b5bd1f6..11d2a1f9 100644 --- a/src/entities/Physical.h +++ b/src/entities/Physical.h @@ -30,7 +30,7 @@ public: float fForceMultiplier; float m_fAirResistance; float m_fElasticity; - float fPercentSubmerged; + float m_fBuoyancy; CVector m_vecCentreOfMass; CEntryInfoList m_entryInfoList; CPtrNode *m_movingListNode; |