From 98203d4d0034dab5db72737bcfb92017a11f3245 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Tue, 6 Mar 2018 17:08:00 +0100 Subject: I might have been using JSON the wrong way. --- src/struct/attack.erl | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src/struct/attack.erl') diff --git a/src/struct/attack.erl b/src/struct/attack.erl index 7b81adc..7f6b302 100644 --- a/src/struct/attack.erl +++ b/src/struct/attack.erl @@ -281,7 +281,7 @@ get_sequence (AttackRange, AttackerWeapon, DefenderWeapon) -> [First, Counter, Second] end. --spec encode (struct()) -> binary(). +-spec encode (struct()) -> {list(any())}. % This shouldn't be a possibility. Types in this module are a mess... encode (Attack) -> Order = Attack#attack.order, @@ -290,15 +290,12 @@ encode (Attack) -> IsParry = Attack#attack.is_parry, Damage = Attack#attack.damage, - jiffy:encode - ( - { - [ - {<<"ord">>, encode_order(Order)}, - {<<"pre">>, encode_precision(Precision)}, - {<<"cri">>, IsCritical}, - {<<"par">>, IsParry}, - {<<"dmg">>, Damage} - ] - } - ). + { + [ + {<<"ord">>, encode_order(Order)}, + {<<"pre">>, encode_precision(Precision)}, + {<<"cri">>, IsCritical}, + {<<"par">>, IsParry}, + {<<"dmg">>, Damage} + ] + }. -- cgit v1.2.3-70-g09d2