diff --git a/src/egs.erl b/src/egs.erl index 2180a4d..af8c72d 100644 --- a/src/egs.erl +++ b/src/egs.erl @@ -17,7 +17,7 @@ % along with EGS. If not, see . -module(egs). --export([start/0, reload/0, global/2, warp/3]). +-export([start/0, reload/0, global/2, warp/3, warp/4]). -include("include/records.hrl"). @@ -51,3 +51,9 @@ global(Type, Message) -> warp(MapType, MapNumber, MapEntry) -> lists:foreach(fun(User) -> egs_game:lobby_load(User#users.socket, User#users.gid, MapType, MapNumber, MapEntry) end, egs_db:users_select_all()). + +%% @doc Warp one player to a new map. + +warp(GID, MapType, MapNumber, MapEntry) -> + User = egs_db:users_select(GID), + egs_game:lobby_load(User#users.socket, User#users.gid, MapType, MapNumber, MapEntry).