From 43b4f6b26366acab456a8c49bb49154ed2f0b271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 5 Jun 2010 20:27:07 +0200 Subject: [PATCH] game: Counter options are data and should be separated (mission visible/not). --- include/maps.hrl | 2 +- src/egs_game.erl | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/maps.hrl b/include/maps.hrl index 6539730..6bf6727 100644 --- a/include/maps.hrl +++ b/include/maps.hrl @@ -113,7 +113,7 @@ -define(COUNTERS, [ % Colony mission counters { 10497, [{lobby, [1100000, 0]}, {data, [ - {0, "data/missions/colony.counter.ll.pack"} + {0, [{filename, "data/missions/colony.counter.ll.pack"}, {options, << 16#01a92800:32, 3, 3, 0, 3, 3, 3, 3, 0, 0:40, 3, 3, 3, 3, 3, 0:176 >>}]} ]}] }, % Lumilass { 731394, [{lobby, [1100000,11]}, {data, none}] } diff --git a/src/egs_game.erl b/src/egs_game.erl index 05fd989..283e8f5 100644 --- a/src/egs_game.erl +++ b/src/egs_game.erl @@ -649,7 +649,7 @@ handle(16#0c01, CSocket, GID, _, Orig) -> handle(16#0c05, CSocket, GID, _, _) -> User = egs_db:users_select(GID), [{lobby, _}, {data, Data}] = proplists:get_value(User#users.quest, ?COUNTERS), - Filename = proplists:get_value(User#users.mapentry, Data), + [{filename, Filename}, {options, _}] = proplists:get_value(User#users.mapentry, Data), {ok, << File/bits >>} = file:read_file(Filename), Packet = << 16#0c060300:32, 0:288, 1:32/little-unsigned-integer, File/binary, 0:32 >>, egs_proto:packet_send(CSocket, Packet); @@ -672,9 +672,11 @@ handle(16#0c0e, CSocket, GID, _, _) -> %% @todo Temporarily allow rare mission and LL all difficulties to all players. handle(16#0c0f, CSocket, GID, _, _) -> + User = egs_db:users_select(GID), + [{lobby, _}, {data, Data}] = proplists:get_value(User#users.quest, ?COUNTERS), + [{filename, _}, {options, Options}] = proplists:get_value(User#users.mapentry, Data), Packet = << 16#0c100300:32, 0:32, 16#00011300:32, GID:32/little-unsigned-integer, 0:64, - 16#00011300:32, GID:32/little-unsigned-integer, 0:64, 16#01a92800:32, 3, 3, 0, - 3, 3, 3, 3, 0, 0:40, 3, 3, 3, 3, 3, 0:176 >>, + 16#00011300:32, GID:32/little-unsigned-integer, 0:64, Options/binary >>, egs_proto:packet_send(CSocket, Packet); %% @doc Set flag handler. Associate a new flag with the character.