diff --git a/src/MetroidPrime/CDamageVulnerability.cpp b/src/MetroidPrime/CDamageVulnerability.cpp index d029274f..42489bb2 100644 --- a/src/MetroidPrime/CDamageVulnerability.cpp +++ b/src/MetroidPrime/CDamageVulnerability.cpp @@ -95,33 +95,33 @@ CDamageVulnerability::CDamageVulnerability(EVulnerability power, EVulnerability EVulnerability enemyWp2, EVulnerability enemyWp3, EVulnerability enemyWp4, EVulnerability v1, EVulnerability v2, EDeflectionType deflectType) { - this->x0_normal[0] = power; - this->x0_normal[1] = ice; - this->x0_normal[2] = wave; - this->x0_normal[3] = plasma; - this->x0_normal[4] = bomb; - this->x0_normal[5] = powerBomb; - this->x0_normal[6] = missile; - this->x0_normal[7] = boostBall; - this->x0_normal[8] = phazon; - this->x0_normal[9] = enemyWp1; - this->x0_normal[10] = enemyWp2; - this->x0_normal[0xb] = enemyWp3; - this->x0_normal[0xc] = enemyWp4; - this->x0_normal[0xd] = v1; - this->x0_normal[0xe] = v2; - this->x3c_charged[0] = this->x0_normal[0]; - this->x4c_combo[0] = this->x0_normal[0]; - this->x3c_charged[1] = this->x0_normal[1]; - this->x4c_combo[1] = this->x0_normal[1]; - this->x3c_charged[2] = this->x0_normal[2]; - this->x4c_combo[2] = this->x0_normal[2]; - this->x3c_charged[3] = this->x0_normal[3]; - this->x4c_combo[3] = this->x0_normal[3]; + x0_normal[0] = power; + x0_normal[1] = ice; + x0_normal[2] = wave; + x0_normal[3] = plasma; + x0_normal[4] = bomb; + x0_normal[5] = powerBomb; + x0_normal[6] = missile; + x0_normal[7] = boostBall; + x0_normal[8] = phazon; + x0_normal[9] = enemyWp1; + x0_normal[10] = enemyWp2; + x0_normal[11] = enemyWp3; + x0_normal[12] = enemyWp4; + x0_normal[13] = v1; + x0_normal[14] = v2; + x3c_charged[0] = x0_normal[0]; + x4c_combo[0] = x0_normal[0]; + x3c_charged[1] = x0_normal[1]; + x4c_combo[1] = x0_normal[1]; + x3c_charged[2] = x0_normal[2]; + x4c_combo[2] = x0_normal[2]; + x3c_charged[3] = x0_normal[3]; + x4c_combo[3] = x0_normal[3]; x5c_deflect = deflectType; } -static inline bool check_hurts(EVulnerability vuln, bool direct) { +static inline bool check_hurts(EVulnerability vuln, int direct) { return direct == 0 ? (is_normal_or_weak(vuln) || vuln == kVN_DirectWeak || vuln == kVN_DirectNormal) : is_normal_or_weak(vuln); @@ -149,16 +149,13 @@ bool CDamageVulnerability::WeaponHurts(const CWeaponMode& mode, int ignoreDirect } static inline bool check_hits(EVulnerability vuln, int direct) { - if (!direct) { - return is_not_deflect(vuln); - } - if (vuln == kVN_Deflect || - (static_cast< EVulnerability >(static_cast< u32 >(vuln) - - static_cast< u32 >(kVN_DirectWeak)) <= kVN_Normal) || - vuln == kVN_DirectImmune) { - return false; - } - return true; + if (!direct) { + return is_not_deflect(vuln); + } + if (vuln == kVN_Deflect || ((u32)vuln - kVN_DirectWeak <= kVN_Normal) || vuln == kVN_DirectImmune) { + return false; + } + return true; } bool CDamageVulnerability::WeaponHits(const CWeaponMode& mode, int checkDirect) const {