summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2018-01-22 12:55:26 +0100 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2018-01-22 12:55:26 +0100 |
commit | bf751b384f9207226fc8b7ec662eac32d8bc81eb (patch) | |
tree | da1c04075029c06d0af6c5f4b8bb3402c2d060ae /src/reply | |
parent | b056dfc549d445b8cc6a16c8076888289a1db9e0 (diff) |
Links the fragments of new stats to the old ones.
Diffstat (limited to 'src/reply')
-rw-r--r-- | src/reply/add_char.erl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/reply/add_char.erl b/src/reply/add_char.erl index 959c70f..99b1d25 100644 --- a/src/reply/add_char.erl +++ b/src/reply/add_char.erl @@ -14,6 +14,9 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% encode (Char, CharInstance, IsEnabled) -> {X, Y} = character_instance:get_location(CharInstance), + Stats = character_instance:get_statistics(CharInstance), + ActWeapon = character_instance:get_active_weapon(CharInstance, Char), + {_MinRg, MaxRg} = weapon:get_ranges(ActWeapon), jiffy:encode ( { @@ -23,12 +26,12 @@ encode (Char, CharInstance, IsEnabled) -> {<<"icon">>, character:get_icon(Char)}, {<<"portrait">>, character:get_portrait(Char)}, {<<"health">>, character_instance:get_current_health(CharInstance)}, - {<<"max_health">>, character:get_max_health(Char)}, {<<"loc_x">>, X}, {<<"loc_y">>, Y}, {<<"team">>, character_instance:get_owner(CharInstance)}, - {<<"mov_pts">>, character:get_movement_points(Char)}, - {<<"atk_rg">>, character:get_attack_range(Char)}, + {<<"max_health">>, statistics:get_health(Stats)}, + {<<"mov_pts">>, statistics:get_movement_points(Stats)}, + {<<"atk_rg">>, MaxRg}, {<<"enabled">>, IsEnabled} ] } |