summaryrefslogtreecommitdiff
path: root/src/game/g_admin.c
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-02-06 19:19:33 +0100
committer/dev/humancontroller <devhc@example.com>2017-03-09 13:51:16 +0100
commitec2f1dc2f6444d33f3d112be486e9d7675358bd6 (patch)
tree57f10fa18f031cbb0531eecfc9a1417988cb6cc0 /src/game/g_admin.c
parentff4fd573a91bc027c935f32fab107eca66659141 (diff)
implement layout arithmetic and the addlayout command
layout arithmetic features: layout filtering by buildable team or type, loading of union of filtered layouts, saving filtered layouts addlayout: an admin command to place layout elements into the game
Diffstat (limited to 'src/game/g_admin.c')
-rw-r--r--src/game/g_admin.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index 62a45572..18f317d4 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -38,6 +38,15 @@ static char g_bfb[ 32000 ];
// note: list ordered alphabetically
g_admin_cmd_t g_admin_cmds[ ] =
{
+ {"addlayout", G_admin_addlayout, qfalse, "addlayout",
+ "place layout elements into the game. the elements are specified by a "
+ "union of filtered layouts. the syntax is demonstrated by an example: "
+ "^5westside|reactor,telenode+sewers|alien^7 will place only the "
+ "reactor and telenodes from the westside layout, and also all alien "
+ "layout elements from the sewers layout",
+ "[^3layoutelements^7]"
+ },
+
{"adjustban", G_admin_adjustban, qfalse, "ban",
"change the IP address mask, duration or reason of a ban. mask is "
"prefixed with '/'. duration is specified as numbers followed by units "
@@ -1858,6 +1867,25 @@ qboolean G_admin_unban( gentity_t *ent )
return qtrue;
}
+qboolean G_admin_addlayout( gentity_t *ent )
+{
+ char layout[ MAX_QPATH ];
+
+ if( trap_Argc( ) != 2 )
+ {
+ ADMP( "^3addlayout: ^7usage: addlayout <layoutelements>\n" );
+ return qfalse;
+ }
+
+ trap_Argv( 1, layout, sizeof( layout ) );
+
+ G_LayoutLoad( layout );
+
+ AP( va( "print \"^3addlayout: ^7some layout elements have been placed by %s\n\"",
+ ent ? ent->client->pers.netname : "console" ) );
+ return qtrue;
+}
+
qboolean G_admin_adjustban( gentity_t *ent )
{
int bnum;