summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2017-11-24 17:38:49 +0100 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2017-11-24 17:38:49 +0100 |
commit | dbdadc5492bdae0107dd033184544e70435da2f7 (patch) | |
tree | 5c847b4e7b69195b02d4ff130d0148b25059522c /www/handler | |
parent | 9dd67cd5c63ac2a050a517c313f2e343f008421b (diff) |
Working on disabling chars that shouldn't be used.
Diffstat (limited to 'www/handler')
-rw-r--r-- | www/handler/battlemap/load_state.yaws | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/www/handler/battlemap/load_state.yaws b/www/handler/battlemap/load_state.yaws index 5c37764..998e22c 100644 --- a/www/handler/battlemap/load_state.yaws +++ b/www/handler/battlemap/load_state.yaws @@ -25,7 +25,7 @@ generate_set_map (Battlemap) -> } ). -generate_add_char (Char, CharInstance) -> +generate_add_char (Char, CharInstance, BattlemapInstance, PlayerID) -> jiffy:encode ( { @@ -38,12 +38,21 @@ generate_add_char (Char, CharInstance) -> {<<"loc_y">>, CharInstance#character_instance.y}, {<<"team">>, CharInstance#character_instance.team}, {<<"mov_pts">>, Char#character.mov_pts}, - {<<"atk_rg">>, Char#character.atk_rg} + {<<"atk_rg">>, Char#character.atk_rg}, + { + <<"enabled">>, + battlemap_instance:can_play_char_instance + ( + BattlemapInstance, + Char#character.id, + PlayerID + ) + } ] } ). -generate_reply (Battlemap, _BattlemapInstance, Characters) -> +generate_reply (Battlemap, BattlemapInstance, Characters, PlayerID) -> jiffy:encode ( [ @@ -57,7 +66,13 @@ generate_reply (Battlemap, _BattlemapInstance, Characters) -> fun ({CharID, CharInstance}) -> [ <<"add_char">>, - generate_add_char(CharID, CharInstance) + generate_add_char + ( + CharID, + CharInstance, + BattlemapInstance, + PlayerID + ) ] end, Characters @@ -91,7 +106,13 @@ handle (Req) -> %%%% Calc %%%% Commit %%%% Reply - generate_reply(Battlemap, BattlemapInstance, Characters). + generate_reply + ( + Battlemap, + BattlemapInstance, + Characters, + Input#input.player_id + ). out(A) -> { |