[Bug Fix] Correctly limit max targets of PBAOE (#4507)

* fix pbaoe max targets incorrectly set

* fix scratch copy
This commit is contained in:
catapultam-habeo 2024-10-11 12:15:19 -05:00 committed by GitHub
parent 448a33a60c
commit ed2130f649
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -515,6 +515,8 @@ RULE_BOOL(Spells, ManaTapsOnAnyClass, false, "Enabling this will allow you to ca
RULE_INT(Spells, HealAmountMessageFilterThreshold, 100, "Lifetaps below this threshold will not have a message sent to the client (Heal will still process) 0 to Disable.")
RULE_BOOL(Spells, SnareOverridesSpeedBonuses, false, "Enabling will allow snares to override any speed bonuses the entity may have. Default: False")
RULE_INT(Spells, TargetedAOEMaxTargets, 4, "Max number of targets a Targeted AOE spell can cast on. Set to 0 for no limit.")
RULE_INT(Spells, PointBlankAOEMaxTargets, 0, "Max number of targets a Point-Blank AOE spell can cast on. Set to 0 for no limit.")
RULE_INT(Spells, DefaultAOEMaxTargets, 4, "Max number of targets that an AOE spell which does not meet other descriptions can cast on. Set to 0 for no limit.")
RULE_CATEGORY_END()
RULE_CATEGORY(Combat)

View File

@ -1096,7 +1096,7 @@ void EntityList::AESpell(
max_targets = nullptr;
}
int max_targets_allowed = 4;
int max_targets_allowed = RuleI(Spells, DefaultAOEMaxTargets);;
if (max_targets) { // rains pass this in since they need to preserve the count through waves
max_targets_allowed = *max_targets;
} else if (spells[spell_id].aoe_max_targets) {
@ -1109,6 +1109,12 @@ void EntityList::AESpell(
!IsEffectInSpell(spell_id, SE_Mez)
) {
max_targets_allowed = RuleI(Spells, TargetedAOEMaxTargets);
} else if (
IsPBAENukeSpell(spell_id) &&
IsDetrimentalSpell &&
!is_npc
) {
max_targets_allowed = RuleI(Spells, PointBlankAOEMaxTargets);
}
int target_hit_counter = 0;