mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2025-01-11 09:29:09 +01:00
Refactor CObject::ObjectDamage switch statement
This commit is contained in:
parent
c2b00d7ad9
commit
16360eb6df
@ -169,26 +169,35 @@ CObject::ObjectDamage(float amount)
|
||||
amount = 0.0f;
|
||||
}
|
||||
if ((amount * m_fCollisionDamageMultiplier > 150.0f || bBodyCastDamageEffect) && m_nCollisionDamageEffect) {
|
||||
if (m_nCollisionDamageEffect == COLDAMAGE_EFFECT_CHANGE_MODEL) {
|
||||
const CVector& vecPos = m_matrix.GetPosition();
|
||||
const float fDirectionZ = 0.0002f * amount;
|
||||
switch (m_nCollisionDamageEffect)
|
||||
{
|
||||
case COLDAMAGE_EFFECT_CHANGE_MODEL:
|
||||
bRenderDamaged = true;
|
||||
return;
|
||||
}
|
||||
if (m_nCollisionDamageEffect == COLDAMAGE_EFFECT_SPLIT_MODEL)
|
||||
return;
|
||||
if (m_nCollisionDamageEffect == COLDAMAGE_EFFECT_SMASH_COMPLETELY) {
|
||||
break;
|
||||
case COLDAMAGE_EFFECT_SPLIT_MODEL:
|
||||
break;
|
||||
case COLDAMAGE_EFFECT_SMASH_COMPLETELY:
|
||||
bIsVisible = false;
|
||||
bUsesCollision = false;
|
||||
bIsStatic = true;
|
||||
bExplosionProof = true;
|
||||
m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
|
||||
m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f);
|
||||
return;
|
||||
case COLDAMAGE_EFFECT_CHANGE_THEN_SMASH:
|
||||
if (!bRenderDamaged) {
|
||||
bRenderDamaged = true;
|
||||
}
|
||||
if (m_nCollisionDamageEffect != COLDAMAGE_EFFECT_CHANGE_THEN_SMASH) {
|
||||
const CVector& vecPos = m_matrix.GetPosition();
|
||||
const float fDirectionZ = 0.0002f * amount;
|
||||
switch (m_nCollisionDamageEffect)
|
||||
{
|
||||
else {
|
||||
bIsVisible = false;
|
||||
bUsesCollision = false;
|
||||
bIsStatic = true;
|
||||
bExplosionProof = true;
|
||||
m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
|
||||
m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
break;
|
||||
case COLDAMAGE_EFFECT_SMASH_CARDBOX_COMPLETELY: {
|
||||
bIsVisible = false;
|
||||
bUsesCollision = false;
|
||||
@ -288,18 +297,6 @@ CObject::ObjectDamage(float amount)
|
||||
default:
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!bRenderDamaged) {
|
||||
bRenderDamaged = true;
|
||||
} else {
|
||||
bIsVisible = false;
|
||||
bUsesCollision = false;
|
||||
bIsStatic = true;
|
||||
bExplosionProof = true;
|
||||
m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
|
||||
m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user