From c894ebe84a8511563322c4075147c976591ade1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 30 Jun 2010 14:02:52 +0200 Subject: [PATCH] game: Fix warping and rename some related variables. --- src/egs.erl | 8 ++++---- src/egs_game.erl | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/egs.erl b/src/egs.erl index 50c8c5e..5eb841d 100644 --- a/src/egs.erl +++ b/src/egs.erl @@ -49,11 +49,11 @@ global(Type, Message) -> %% @doc Warp all players to a new map. -warp(Quest, MapType, MapNumber, MapEntry) -> - lists:foreach(fun(User) -> egs_game:area_load(User#users.socket, User#users.gid, Quest, MapType, MapNumber, MapEntry) end, egs_db:users_select_all()). +warp(QuestID, ZoneID, MapID, EntryID) -> + 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. -warp(GID, Quest, MapType, MapNumber, MapEntry) -> +warp(GID, QuestID, ZoneID, MapID, EntryID) -> 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}. diff --git a/src/egs_game.erl b/src/egs_game.erl index 37bdcbd..b62f771 100644 --- a/src/egs_game.erl +++ b/src/egs_game.erl @@ -461,6 +461,9 @@ loop(SoFar) -> {psu_player_unspawn, Spawn} -> send_0204(Spawn#users.gid, Spawn#users.lid, 5), ?MODULE:loop(SoFar); + {psu_warp, QuestID, ZoneID, MapID, EntryID} -> + area_load(QuestID, ZoneID, MapID, EntryID), + ?MODULE:loop(SoFar); {ssl, _, Data} -> {Packets, Rest} = egs_proto:packet_split(<< SoFar/bits, Data/bits >>), [dispatch(Orig) || Orig <- Packets],