Instant Death Fixes

- Fix some overflows with instant death mode
This commit is contained in:
SuperDude88
2026-08-31 18:24:30 -04:00
parent 93f9ad6f1d
commit 4a632ff5dc
2 changed files with 8 additions and 2 deletions
+3 -2
View File
@@ -157,10 +157,11 @@ f32 daAlink_c::damageMagnification(BOOL i_checkZoraMag, int param_1) {
}
#if TARGET_PC
base_mag *= dusk::getSettings().game.damageMultiplier;
if (dusk::getSettings().game.instantDeath) {
base_mag = 9999.0f;
return 9999.0f; // don't need to multiply this further, 9999 is plenty
}
base_mag *= dusk::getSettings().game.damageMultiplier;
#endif
if (checkWolf() && !checkCargoCarry() && param_1 == 0) {
+5
View File
@@ -606,7 +606,12 @@ void dMeter2_c::moveLife() {
life_count = (dComIfGs_getMaxLife() / 5) * 4;
}
#if TARGET_PC
int new_life = dComIfGs_getLife() + dComIfGp_getItemLifeCount(); // prevent an overflow with really large damage values
#else
s16 new_life = dComIfGs_getLife() + dComIfGp_getItemLifeCount();
#endif
if (new_life > life_count) {
new_life = life_count;
} else if (new_life < 0) {