game: Fix warping and rename some related variables.
This commit is contained in:
parent
0e05b01ce5
commit
c894ebe84a
@ -49,11 +49,11 @@ global(Type, Message) ->
|
|||||||
|
|
||||||
%% @doc Warp all players to a new map.
|
%% @doc Warp all players to a new map.
|
||||||
|
|
||||||
warp(Quest, MapType, MapNumber, MapEntry) ->
|
warp(QuestID, ZoneID, MapID, EntryID) ->
|
||||||
lists:foreach(fun(User) -> egs_game:area_load(User#users.socket, User#users.gid, Quest, MapType, MapNumber, MapEntry) end, egs_db:users_select_all()).
|
lists:foreach(fun(User) -> User#users.pid ! {psu_warp, QuestID, ZoneID, MapID, EntryID} end, egs_db:users_select_all()).
|
||||||
|
|
||||||
%% @doc Warp one player to a new map.
|
%% @doc Warp one player to a new map.
|
||||||
|
|
||||||
warp(GID, Quest, MapType, MapNumber, MapEntry) ->
|
warp(GID, QuestID, ZoneID, MapID, EntryID) ->
|
||||||
User = egs_db:users_select(GID),
|
User = egs_db:users_select(GID),
|
||||||
egs_game:area_load(User#users.socket, User#users.gid, Quest, MapType, MapNumber, MapEntry).
|
User#users.pid ! {psu_warp, QuestID, ZoneID, MapID, EntryID}.
|
||||||
|
@ -461,6 +461,9 @@ loop(SoFar) ->
|
|||||||
{psu_player_unspawn, Spawn} ->
|
{psu_player_unspawn, Spawn} ->
|
||||||
send_0204(Spawn#users.gid, Spawn#users.lid, 5),
|
send_0204(Spawn#users.gid, Spawn#users.lid, 5),
|
||||||
?MODULE:loop(SoFar);
|
?MODULE:loop(SoFar);
|
||||||
|
{psu_warp, QuestID, ZoneID, MapID, EntryID} ->
|
||||||
|
area_load(QuestID, ZoneID, MapID, EntryID),
|
||||||
|
?MODULE:loop(SoFar);
|
||||||
{ssl, _, Data} ->
|
{ssl, _, Data} ->
|
||||||
{Packets, Rest} = egs_proto:packet_split(<< SoFar/bits, Data/bits >>),
|
{Packets, Rest} = egs_proto:packet_split(<< SoFar/bits, Data/bits >>),
|
||||||
[dispatch(Orig) || Orig <- Packets],
|
[dispatch(Orig) || Orig <- Packets],
|
||||||
|
Loading…
Reference in New Issue
Block a user