Add single-person warp function.

This commit is contained in:
Loïc Hoguin 2010-05-22 08:17:09 +02:00
parent 778eddc298
commit c0fdfd7a26

View File

@ -17,7 +17,7 @@
% along with EGS. If not, see <http://www.gnu.org/licenses/>. % along with EGS. If not, see <http://www.gnu.org/licenses/>.
-module(egs). -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"). -include("include/records.hrl").
@ -51,3 +51,9 @@ global(Type, Message) ->
warp(MapType, MapNumber, MapEntry) -> 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()). 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).