pred@2077: /**
pred@2077: * vim: set ts=4 :
pred@2077: * =============================================================================
pred@2077: * SourceMod
pred@2077: * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
pred@2077: * =============================================================================
pred@2077: *
pred@2077: * This program is free software; you can redistribute it and/or modify it under
pred@2077: * the terms of the GNU General Public License, version 3.0, as published by the
pred@2077: * Free Software Foundation.
pred@2077: *
pred@2077: * This program is distributed in the hope that it will be useful, but WITHOUT
pred@2077: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
pred@2077: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
pred@2077: * details.
pred@2077: *
pred@2077: * You should have received a copy of the GNU General Public License along with
pred@2077: * this program. If not, see .
pred@2077: *
pred@2077: * As a special exception, AlliedModders LLC gives you permission to link the
pred@2077: * code of this program (as well as its derivative works) to "Half-Life 2," the
pred@2077: * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
pred@2077: * by the Valve Corporation. You must obey the GNU General Public License in
pred@2077: * all respects for all other code used. Additionally, AlliedModders LLC grants
pred@2077: * this exception to all derivative works. AlliedModders LLC defines further
pred@2077: * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
pred@2077: * or .
pred@2077: *
pred@2077: * Version: $Id$
pred@2077: */
pred@2077:
pred@2077: #include "sm_globals.h"
pred@2077: #include "NextMap.h"
pred@2077:
pred@2077: static cell_t sm_GetNextMap(IPluginContext *pCtx, const cell_t *params)
pred@2077: {
pred@2077: const char *map = g_NextMap.GetNextMap();
pred@2077:
pred@2077: if (map[0] == 0)
pred@2077: {
pred@2077: return 0;
pred@2077: }
pred@2077:
pred@2077: pCtx->StringToLocal(params[1], params[2], map);
pred@2077:
pred@2077: return 1;
pred@2077: }
pred@2077:
pred@2077: static cell_t sm_SetNextMap(IPluginContext *pCtx, const cell_t *params)
pred@2077: {
pred@2077: char *map;
pred@2077: pCtx->LocalToString(params[1], &map);
pred@2077:
pred@2077: return g_NextMap.SetNextMap(map);
pred@2077: }
pred@2077:
pred@2077:
pred@2077: REGISTER_NATIVES(nextmapnatives)
pred@2077: {
pred@2077: {"GetNextMap", sm_GetNextMap},
pred@2077: {"SetNextMap", sm_SetNextMap},
pred@2077: {NULL, NULL},
pred@2077: };