From 0ec47fd7d8c7ffbf962b3e5105f26bc677a639a3 Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Sat, 16 Sep 2017 21:05:30 +0200 Subject: implement !control --- src/game/g_utils.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/game/g_utils.c') diff --git a/src/game/g_utils.c b/src/game/g_utils.c index a74df3f..272c968 100644 --- a/src/game/g_utils.c +++ b/src/game/g_utils.c @@ -162,6 +162,17 @@ void G_TeamCommand( pTeam_t team, char *cmd ) { if( level.clients[ i ].pers.connected == CON_CONNECTED ) { + if (level.clients[i].pers.control > 0) + { + int j = level.clients[i].pers.control - 1; + + if (level.clients[j].pers.teamSelection == team + || (level.clients[j].pers.teamSelection == PTE_NONE + && G_admin_permission(&g_entities[j], ADMF_SPEC_ALLCHAT))) + { + continue; + } + } if( level.clients[ i ].pers.teamSelection == team || ( level.clients[ i ].pers.teamSelection == PTE_NONE && G_admin_permission( &g_entities[ i ], ADMF_SPEC_ALLCHAT ) ) ) @@ -828,6 +839,10 @@ void G_TriggerMenu( int clientNum, dynMenu_t menu ) { char buffer[ 32 ]; + clientPersistant_t *p = &g_clients[clientNum].pers; + if (p->control > 0 || (p->isPlaceholder && p->control >= 0)) + return; + Com_sprintf( buffer, 32, "servermenu %d", menu ); trap_SendServerCommand( clientNum, buffer ); } -- cgit