aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2019-09-30 18:12:54 +0200
committernsensfel <SpamShield0@noot-noot.org>2019-09-30 18:12:54 +0200
commit3db4177ebf2d3c8cca27e352644c1efa1a1a3580 (patch)
tree2f7d66934b9491879d01384b487a83bb1809f328
parent4f4987582ee41e2c68aad3b467b40eaed2ae9111 (diff)
downloadtacticians-server-3db4177ebf2d3c8cca27e352644c1efa1a1a3580.zip
tacticians-server-3db4177ebf2d3c8cca27e352644c1efa1a1a3580.tar.bz2
Ensure same char can do multiple AoOs.
-rw-r--r--src/battle/mechanic/action/btl_action_move.erl11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/battle/mechanic/action/btl_action_move.erl b/src/battle/mechanic/action/btl_action_move.erl
index 97cec25..eed7add 100644
--- a/src/battle/mechanic/action/btl_action_move.erl
+++ b/src/battle/mechanic/action/btl_action_move.erl
@@ -21,7 +21,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--spec generate_attacks_of_opportunity_candidates
+-spec generate_attack_of_opportunity_candidates
(
btl_character:either(),
shr_location:type(),
@@ -29,7 +29,7 @@
non_neg_integer()
)
-> list(attack_candidate_ref()).
-generate_attacks_of_opportunity_candidates
+generate_attack_of_opportunity_candidates
(
Character,
Location,
@@ -103,9 +103,12 @@ detect_attacks_of_opportunity (Location, Candidates, RemainingStepsCount) ->
- CandidateAttackRange
),
if
- (Range =< 0) -> {FutureCandidates, [CandidateIX|Attackers]};
+ (Range =< 0) ->
+ {[Candidate|FutureCandidates], [CandidateIX|Attackers]};
+
(Range =< RemainingStepsCount) ->
{[Candidate|FutureCandidates], Attackers};
+
true -> {FutureCandidates, Attackers}
end
end,
@@ -343,7 +346,7 @@ get_path_cost_and_destination (CharacterIX, Character, Update, Path) ->
ForbiddenLocations = generate_forbidden_locations(CharacterIX, Characters),
AttacksOfOpportunityCandidates =
- generate_attacks_of_opportunity_candidates
+ generate_attack_of_opportunity_candidates
(
Character,
Location,