diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/entities/Physical.cpp | 4 | ||||
-rw-r--r-- | src/objects/Object.cpp | 16 | ||||
-rw-r--r-- | src/objects/Object.h | 29 | ||||
-rw-r--r-- | src/peds/Ped.cpp | 4 |
4 files changed, 31 insertions, 22 deletions
diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp index 3f1ec325..fe270645 100644 --- a/src/entities/Physical.cpp +++ b/src/entities/Physical.cpp @@ -1837,7 +1837,7 @@ CPhysical::ProcessCollision(void) step = savedTimeStep / n; }else if(IsObject()){ int responsecase = ((CObject*)this)->m_nSpecialCollisionResponseCases; - if(responsecase == COLLRESPONSE_CHANGE_MODEL){ + if(responsecase == COLLRESPONSE_LAMPOST){ CVector speedUp = { 0.0f, 0.0f, 0.0f }; CVector speedDown = { 0.0f, 0.0f, 0.0f }; speedUp.z = GetBoundRadius(); @@ -1856,7 +1856,7 @@ CPhysical::ProcessCollision(void) n = NUMSTEPS(0.09f); step = savedTimeStep / n; } - }else if(responsecase == COLLRESPONSE_SPLIT_MODEL || responsecase == COLLRESPONSE_CHANGE_THEN_SMASH){ + }else if(responsecase == COLLRESPONSE_SMALLBOX || responsecase == COLLRESPONSE_FENCEPART){ if(distSq >= sq(0.15f)){ n = NUMSTEPS(0.15f); step = savedTimeStep / n; diff --git a/src/objects/Object.cpp b/src/objects/Object.cpp index de883b89..a5896975 100644 --- a/src/objects/Object.cpp +++ b/src/objects/Object.cpp @@ -174,12 +174,12 @@ CObject::ObjectDamage(float amount) const float fDirectionZ = 0.0002f * amount; switch (m_nCollisionDamageEffect) { - case COLLRESPONSE_CHANGE_MODEL: + case DAMAGE_EFFECT_CHANGE_MODEL: bRenderDamaged = true; break; - case COLLRESPONSE_SPLIT_MODEL: + case DAMAGE_EFFECT_SPLIT_MODEL: break; - case COLLRESPONSE_SMASH_COMPLETELY: + case DAMAGE_EFFECT_SMASH_COMPLETELY: bIsVisible = false; bUsesCollision = false; bIsStatic = true; @@ -187,7 +187,7 @@ CObject::ObjectDamage(float amount) SetMoveSpeed(0.0f, 0.0f, 0.0f); SetTurnSpeed(0.0f, 0.0f, 0.0f); break; - case COLLRESPONSE_CHANGE_THEN_SMASH: + case DAMAGE_EFFECT_CHANGE_THEN_SMASH: if (!bRenderDamaged) { bRenderDamaged = true; } @@ -200,7 +200,7 @@ CObject::ObjectDamage(float amount) SetTurnSpeed(0.0f, 0.0f, 0.0f); } break; - case COLLRESPONSE_SMASH_CARDBOARD_COMPLETELY: { + case DAMAGE_EFFECT_SMASH_CARDBOARD_COMPLETELY: { bIsVisible = false; bUsesCollision = false; bIsStatic = true; @@ -223,7 +223,7 @@ CObject::ObjectDamage(float amount) PlayOneShotScriptObject(_SCRSOUND_CARDBOARD_BOX_SMASH, vecPos); break; } - case COLLRESPONSE_SMASH_WOODENBOX_COMPLETELY: { + case DAMAGE_EFFECT_SMASH_WOODENBOX_COMPLETELY: { bIsVisible = false; bUsesCollision = false; bIsStatic = true; @@ -246,7 +246,7 @@ CObject::ObjectDamage(float amount) PlayOneShotScriptObject(_SCRSOUND_WOODEN_BOX_SMASH, vecPos); break; } - case COLLRESPONSE_SMASH_TRAFFICCONE_COMPLETELY: { + case DAMAGE_EFFECT_SMASH_TRAFFICCONE_COMPLETELY: { bIsVisible = false; bUsesCollision = false; bIsStatic = true; @@ -271,7 +271,7 @@ CObject::ObjectDamage(float amount) PlayOneShotScriptObject(_SCRSOUND_TYRE_BUMP, vecPos); break; } - case COLLRESPONSE_SMASH_BARPOST_COMPLETELY: { + case DAMAGE_EFFECT_SMASH_BARPOST_COMPLETELY: { bIsVisible = false; bUsesCollision = false; bIsStatic = true; diff --git a/src/objects/Object.h b/src/objects/Object.h index dfaa60db..80b9015c 100644 --- a/src/objects/Object.h +++ b/src/objects/Object.h @@ -10,19 +10,28 @@ enum { CUTSCENE_OBJECT = 4, }; -enum { +enum CollisionSpecialResponseCase +{ COLLRESPONSE_NONE, - COLLRESPONSE_CHANGE_MODEL, - COLLRESPONSE_SPLIT_MODEL, - COLLRESPONSE_SMASH_COMPLETELY, - COLLRESPONSE_CHANGE_THEN_SMASH, - COLLRESPONSE_UNKNOWN5, + COLLRESPONSE_LAMPOST, + COLLRESPONSE_SMALLBOX, + COLLRESPONSE_BIGBOX, + COLLRESPONSE_FENCEPART, + COLLRESPONSE_UNKNOWN5 +}; - COLLRESPONSE_SMASH_CARDBOARD_COMPLETELY = 50, - COLLRESPONSE_SMASH_WOODENBOX_COMPLETELY = 60, - COLLRESPONSE_SMASH_TRAFFICCONE_COMPLETELY = 70, - COLLRESPONSE_SMASH_BARPOST_COMPLETELY = 80, +enum CollisionDamageEffect +{ + DAMAGE_EFFECT_NONE, + DAMAGE_EFFECT_CHANGE_MODEL, + DAMAGE_EFFECT_SPLIT_MODEL, + DAMAGE_EFFECT_SMASH_COMPLETELY, + DAMAGE_EFFECT_CHANGE_THEN_SMASH, + DAMAGE_EFFECT_SMASH_CARDBOARD_COMPLETELY = 50, + DAMAGE_EFFECT_SMASH_WOODENBOX_COMPLETELY = 60, + DAMAGE_EFFECT_SMASH_TRAFFICCONE_COMPLETELY = 70, + DAMAGE_EFFECT_SMASH_BARPOST_COMPLETELY = 80 }; class CVehicle; diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index 2048d805..0a0a807d 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -9548,7 +9548,7 @@ CPed::ProcessControl(void) { CBaseModelInfo *collidingModel = CModelInfo::GetModelInfo(collidingEnt->GetModelIndex()); CColModel *collidingCol = collidingModel->GetColModel(); - if (collidingEnt->IsObject() && ((CObject*)collidingEnt)->m_nSpecialCollisionResponseCases != COLLRESPONSE_CHANGE_THEN_SMASH + if (collidingEnt->IsObject() && ((CObject*)collidingEnt)->m_nSpecialCollisionResponseCases != COLLRESPONSE_FENCEPART || collidingCol->boundingBox.max.x < 3.0f && collidingCol->boundingBox.max.y < 3.0f) { @@ -16931,7 +16931,7 @@ CPed::SpawnFlyingComponent(int pedNode, int8 direction) obj->ObjectCreatedBy = TEMP_OBJECT; obj->bIsStatic = false; obj->bIsPickup = false; - obj->m_nSpecialCollisionResponseCases = COLLRESPONSE_SPLIT_MODEL; + obj->m_nSpecialCollisionResponseCases = COLLRESPONSE_SMALLBOX; // life time - the more objects the are, the shorter this one will live CObject::nNoTempObjects++; |