summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-05-25 23:33:52 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-05-25 23:33:52 +0200
commit421de60ec7e969705bef68780507f1fc384f179c (patch)
treecdb72de6b637276319d4dc9593474eefb159de29 /src/battle/struct
parent526f9be120ac1ebd1c9014148f663dba10158c52 (diff)
Fixes some of the errors w/ wrong S_Var being used.
Diffstat (limited to 'src/battle/struct')
-rw-r--r--src/battle/struct/btl_character_turn_request.erl16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/battle/struct/btl_character_turn_request.erl b/src/battle/struct/btl_character_turn_request.erl
index 9f5747f..0a9fa7d 100644
--- a/src/battle/struct/btl_character_turn_request.erl
+++ b/src/battle/struct/btl_character_turn_request.erl
@@ -54,13 +54,21 @@ validate_actions (Actions) ->
{AreValid, _LastAction} =
lists:foldl
(
- fun (Action, {CurrentResult, PrevAction}) ->
+ fun (Action, {CurrentResult, PrevActionCategory}) ->
+ ActionCategory = btl_action:get_category(Action),
{
case CurrentResult of
- false -> false;
- true -> btl_action:can_follow(PrevAction, Action)
+ false ->
+ error({action, PrevActionCategory, ActionCategory}),
+ false;
+ true ->
+ btl_action:can_follow
+ (
+ PrevActionCategory,
+ ActionCategory
+ )
end,
- Action
+ ActionCategory
}
end,
{true, nothing},