mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-09 10:54:06 -04:00
Instant Death Fixes
- Fix some overflows with instant death mode
This commit is contained in:
@@ -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