mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-01 08:22:58 -04:00
Instant Death Fixes
- Fix some overflows with instant death mode
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user