From c0fdfd7a26410236147e5811442ee76071418ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 22 May 2010 08:17:09 +0200 Subject: [PATCH] Add single-person warp function. --- src/egs.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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).