We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5438ff3 commit 6f61cbfCopy full SHA for 6f61cbf
src/Ext/Techno/Body.cpp
@@ -308,11 +308,9 @@ bool TechnoExt::ConvertToType(FootClass* pThis, TechnoTypeClass* pToType)
308
309
if (AresFunctions::ConvertTypeTo(pThis, pToType))
310
{
311
- if (pType->Strength == pToType->Strength)
312
- {
313
- // Fixed an issue where morphing could result in -1 health.
314
- pThis->Health = Math::max(1, oldHealth * pToType->Strength / pType->Strength);
315
- }
+ // Fixed an issue where morphing could result in -1 health.
+ double ratio = static_cast<double>(pToType->Strength) / pType->Strength;
+ pThis->Health = static_cast<int>(oldHealth * ratio + 0.5);
316
317
auto const pTypeExt = TechnoExt::ExtMap.Find(static_cast<TechnoClass*>(pThis));
318
pTypeExt->UpdateTypeData(pToType);
0 commit comments