Skip to content

Commit b87371e

Browse files
committed
Applied feedback
regarding the WH re-declaration warning and the double to int
1 parent 65b40ec commit b87371e

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/Ext/RadSite/Body.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ bool RadSiteExt::ExtData::ApplyRadiationDamage(TechnoClass* pTarget, int& damage
1818

1919
// Check if the WH should affect the techno target or skip it
2020
double versus = MapClass::GetTotalDamage(damage, pWarhead, pTarget->GetTechnoType()->Armor, 0);
21-
int nDamageTotal = damage * versus;
21+
int nDamageTotal = static_cast<int>(damage * versus);
2222

2323
if (pTarget->Health > 0 && !pWHExt->CanKill && nDamageTotal >= pTarget->Health)
2424
{
@@ -36,14 +36,9 @@ bool RadSiteExt::ExtData::ApplyRadiationDamage(TechnoClass* pTarget, int& damage
3636
else
3737
{
3838
if (this->Type->GetWarheadDetonateFull())
39-
{
4039
WarheadTypeExt::DetonateAt(pWarhead, pTarget, this->RadInvoker, damage, this->RadHouse);
41-
}
4240
else
43-
{
44-
auto const pWHExt = WarheadTypeExt::ExtMap.Find(pWarhead);
4541
pWHExt->DamageAreaWithTarget(pTarget->GetCoords(), damage, this->RadInvoker, pWarhead, true, this->RadHouse, pTarget);
46-
}
4742

4843
if (!pTarget->IsAlive)
4944
return false;

src/Ext/Techno/Hooks.ReceiveDamage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ DEFINE_HOOK(0x701900, TechnoClass_ReceiveDamage_Shield, 0x6)
2121

2222
int nDamageLeft = *args->Damage;
2323
double versus = MapClass::GetTotalDamage(nDamageLeft, args->WH, pThis->GetTechnoType()->Armor, 0);
24-
int nDamageTotal = nDamageLeft * versus;
24+
int nDamageTotal = static_cast<int>(nDamageLeft * versus);
2525
auto const pWHExt = WarheadTypeExt::ExtMap.Find(args->WH);
2626

2727
if (!args->IgnoreDefenses)
@@ -59,7 +59,7 @@ DEFINE_HOOK(0x701900, TechnoClass_ReceiveDamage_Shield, 0x6)
5959
}
6060

6161
// Update remaining damage and check if the target will die and should be avoided
62-
nDamageTotal = nDamageLeft * versus;
62+
nDamageTotal = static_cast<int>(nDamageLeft * versus);
6363

6464
if (pThis->Health > 0 && !pWHExt->CanKill && nDamageTotal >= pThis->Health)
6565
{

0 commit comments

Comments
 (0)