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],