mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Code edits to the previous commit
This commit is contained in:
@@ -201,15 +201,16 @@ void Stats::UpdateHPStat(fo::GameObject* critter) {
|
|||||||
if (calcStatValue < statFormulas[fo::Stat::STAT_max_hit_points].min) calcStatValue = statFormulas[fo::Stat::STAT_max_hit_points].min;
|
if (calcStatValue < statFormulas[fo::Stat::STAT_max_hit_points].min) calcStatValue = statFormulas[fo::Stat::STAT_max_hit_points].min;
|
||||||
|
|
||||||
if (proto->critter.base.health != calcStatValue) {
|
if (proto->critter.base.health != calcStatValue) {
|
||||||
fo::func::debug_printf("\nWarning: critter PID: %d, ID: %d, has an incorrect base value of the max HP stat: %d (must be %d)",
|
fo::func::debug_printf("\nWarning: %s (PID: %d, ID: %d) has an incorrect base value of the max HP stat: %d, adjusted to %d.",
|
||||||
critter->protoId, critter->id, proto->critter.base.health, calcStatValue);
|
fo::func::critter_name(critter), critter->protoId, critter->id, proto->critter.base.health, calcStatValue);
|
||||||
|
|
||||||
proto->critter.base.health = calcStatValue;
|
proto->critter.base.health = calcStatValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the current HP to match the maximum HP stat for non-party member critters
|
// set the current HP to match the max HP stat for non-party member critters
|
||||||
if (!fo::util::IsPartyMember(critter)) { // prevent free healing for party members when entering random encounter maps
|
// (prevent full healing for party members when entering random encounter maps)
|
||||||
|
if (!fo::util::IsPartyMember(critter) && critter->critter.health > 0) {
|
||||||
critter->critter.health = proto->critter.base.health + proto->critter.bonus.health;
|
critter->critter.health = proto->critter.base.health + proto->critter.bonus.health;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user