From a38766a1b008347df932d7578aa99ae1ef30b4fd Mon Sep 17 00:00:00 2001 From: nsensfel Date: Fri, 18 Jan 2019 15:10:19 +0100 Subject: Looks like there are still issues with DB updates. Switching weapons does not work. In the little test I did, only one of their character got activated once the second player's turn started. --- src/battle/struct/btl_character_turn_request.erl | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/battle/struct/btl_character_turn_request.erl') diff --git a/src/battle/struct/btl_character_turn_request.erl b/src/battle/struct/btl_character_turn_request.erl index e26f79c..faf8d07 100644 --- a/src/battle/struct/btl_character_turn_request.erl +++ b/src/battle/struct/btl_character_turn_request.erl @@ -6,8 +6,8 @@ -define(CHAR_IX_FIELD, <<"cix">>). -define(ACTIONS_FIELD, <<"act">>). -define(ACTIONS_MOVE_FIELD, <<"mov">>). --define(ACTIONS_WPS_FIELD, <<"wps">>). --define(ACTIONS_ATK_FIELD, <<"tar">>). +-define(ACTIONS_WEAPON_SWITCH_FIELD, <<"wps">>). +-define(ACTIONS_ATTACK_FIELD, <<"tar">>). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -65,7 +65,10 @@ decode_actions (Act) -> S2Result = case - btl_battle_action:maybe_decode_atk(maps:get(?ACTIONS_ATK_FIELD, Act)) + btl_battle_action:maybe_decode_attack + ( + maps:get(?ACTIONS_ATTACK_FIELD, Act) + ) of [] -> S1Result; [Atk] -> [Atk|S1Result] @@ -73,13 +76,16 @@ decode_actions (Act) -> S3Result = case - btl_battle_action:maybe_decode_move(maps:get(?ACTIONS_WPS_FIELD, Act)) + btl_battle_action:maybe_decode_weapon_switch + ( + maps:get(?ACTIONS_WEAPON_SWITCH_FIELD, Act) + ) of [] -> S2Result; [Wps] -> [Wps|S2Result] end, - S3Result. + lists:reverse(S3Result). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -- cgit v1.2.3-70-g09d2