mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 11:48:37 +00:00
[Spells] Added constant labeling to all StatBonuses that use as arrays. (#1485)
* constexpr labels added * more updates * more updates * completed * Update common.h * Namespace constants, few minor spelling tweaks Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
@@ -328,10 +328,10 @@ int32 Client::CalcMaxHP()
|
||||
if (current_hp > max_hp) {
|
||||
current_hp = max_hp;
|
||||
}
|
||||
int hp_perc_cap = spellbonuses.HPPercCap[0];
|
||||
int hp_perc_cap = spellbonuses.HPPercCap[SBIndex::RESOURCE_PERCENT_CAP];
|
||||
if (hp_perc_cap) {
|
||||
int curHP_cap = (max_hp * hp_perc_cap) / 100;
|
||||
if (current_hp > curHP_cap || (spellbonuses.HPPercCap[1] && current_hp > spellbonuses.HPPercCap[1])) {
|
||||
if (current_hp > curHP_cap || (spellbonuses.HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP] && current_hp > spellbonuses.HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP])) {
|
||||
|
||||
current_hp = curHP_cap;
|
||||
}
|
||||
@@ -591,10 +591,10 @@ int32 Client::CalcMaxMana()
|
||||
if (current_mana > max_mana) {
|
||||
current_mana = max_mana;
|
||||
}
|
||||
int mana_perc_cap = spellbonuses.ManaPercCap[0];
|
||||
int mana_perc_cap = spellbonuses.ManaPercCap[SBIndex::RESOURCE_PERCENT_CAP];
|
||||
if (mana_perc_cap) {
|
||||
int curMana_cap = (max_mana * mana_perc_cap) / 100;
|
||||
if (current_mana > curMana_cap || (spellbonuses.ManaPercCap[1] && current_mana > spellbonuses.ManaPercCap[1])) {
|
||||
if (current_mana > curMana_cap || (spellbonuses.ManaPercCap[SBIndex::RESOURCE_AMOUNT_CAP] && current_mana > spellbonuses.ManaPercCap[SBIndex::RESOURCE_AMOUNT_CAP])) {
|
||||
current_mana = curMana_cap;
|
||||
}
|
||||
}
|
||||
@@ -1614,10 +1614,10 @@ void Client::CalcMaxEndurance()
|
||||
if (current_endurance > max_end) {
|
||||
current_endurance = max_end;
|
||||
}
|
||||
int end_perc_cap = spellbonuses.EndPercCap[0];
|
||||
int end_perc_cap = spellbonuses.EndPercCap[SBIndex::RESOURCE_PERCENT_CAP];
|
||||
if (end_perc_cap) {
|
||||
int curEnd_cap = (max_end * end_perc_cap) / 100;
|
||||
if (current_endurance > curEnd_cap || (spellbonuses.EndPercCap[1] && current_endurance > spellbonuses.EndPercCap[1])) {
|
||||
if (current_endurance > curEnd_cap || (spellbonuses.EndPercCap[SBIndex::RESOURCE_AMOUNT_CAP] && current_endurance > spellbonuses.EndPercCap[SBIndex::RESOURCE_AMOUNT_CAP])) {
|
||||
current_endurance = curEnd_cap;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user