summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2015-06-08 17:44:55 +0200
committer/dev/humancontroller <devhc@example.com>2017-02-08 02:17:01 +0100
commitad5130290834957a2637e899ffa847420d0510fe (patch)
treed84d7d55fbe902f5b974b4d57fc45ea0a79a3ba6 /src/ui
parent39e8a98f7b567aaefa844edc040b1952ee40a6d6 (diff)
add missing trailing '\n's from strings to execute; add double quotes around substituted argument strings
also transform trailing ';'s to '\n's
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/ui_atoms.c2
-rw-r--r--src/ui/ui_main.c32
-rw-r--r--src/ui/ui_shared.c2
3 files changed, 18 insertions, 18 deletions
diff --git a/src/ui/ui_atoms.c b/src/ui/ui_atoms.c
index c6135dd7..6f99c604 100644
--- a/src/ui/ui_atoms.c
+++ b/src/ui/ui_atoms.c
@@ -187,7 +187,7 @@ static void UI_Me_f( void )
UI_ConcatArgs( 1, buf, sizeof( buf ) );
- trap_Cmd_ExecuteText( EXEC_APPEND, va( "say \"/me %s\"", buf ) );
+ trap_Cmd_ExecuteText( EXEC_APPEND, va( "say \"/me %s\"\n", buf ) );
}
struct uicmd
diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c
index 95aed52b..9f7aacc7 100644
--- a/src/ui/ui_main.c
+++ b/src/ui/ui_main.c
@@ -2862,7 +2862,7 @@ static void UI_RunMenuScript( char **args )
if( Q_stricmp( name, "StartServer" ) == 0 )
{
trap_Cvar_SetValue( "dedicated", Com_Clamp( 0, 2, ui_dedicated.integer ) );
- trap_Cmd_ExecuteText( EXEC_APPEND, va( "wait ; wait ; map %s\n",
+ trap_Cmd_ExecuteText( EXEC_APPEND, va( "wait ; wait ; map \"%s\"\n",
uiInfo.mapList[ui_selectedMap.integer].mapLoadName ) );
}
else if( Q_stricmp( name, "resetDefaults" ) == 0 )
@@ -3036,19 +3036,19 @@ static void UI_RunMenuScript( char **args )
if( uiInfo.previewMovie >= 0 )
trap_CIN_StopCinematic( uiInfo.previewMovie );
- trap_Cmd_ExecuteText( EXEC_APPEND, va( "cinematic %s.roq 2\n", uiInfo.movieList[uiInfo.movieIndex] ) );
+ trap_Cmd_ExecuteText( EXEC_APPEND, va( "cinematic \"%s.roq\" 2\n", uiInfo.movieList[uiInfo.movieIndex] ) );
}
else if( Q_stricmp( name, "RunMod" ) == 0 )
{
trap_Cvar_Set( "fs_game", uiInfo.modList[uiInfo.modIndex].modName );
- trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart;" );
+ trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart\n" );
}
else if( Q_stricmp( name, "RunDemo" ) == 0 )
- trap_Cmd_ExecuteText( EXEC_APPEND, va( "demo %s\n", uiInfo.demoList[uiInfo.demoIndex] ) );
+ trap_Cmd_ExecuteText( EXEC_APPEND, va( "demo \"%s\"\n", uiInfo.demoList[uiInfo.demoIndex] ) );
else if( Q_stricmp( name, "Tremulous" ) == 0 )
{
trap_Cvar_Set( "fs_game", "" );
- trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart;" );
+ trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart\n" );
}
else if( Q_stricmp( name, "closeJoin" ) == 0 )
{
@@ -3124,7 +3124,7 @@ static void UI_RunMenuScript( char **args )
}
}
else if( Q_stricmp( name, "Quit" ) == 0 )
- trap_Cmd_ExecuteText( EXEC_APPEND, "quit" );
+ trap_Cmd_ExecuteText( EXEC_APPEND, "quit\n" );
else if( Q_stricmp( name, "Leave" ) == 0 )
{
trap_Cmd_ExecuteText( EXEC_APPEND, "disconnect\n" );
@@ -3160,7 +3160,7 @@ static void UI_RunMenuScript( char **args )
{
if( ui_selectedMap.integer >= 0 && ui_selectedMap.integer < uiInfo.mapCount )
{
- trap_Cmd_ExecuteText( EXEC_APPEND, va( "callvote map %s\n",
+ trap_Cmd_ExecuteText( EXEC_APPEND, va( "callvote map \"%s\"\n",
uiInfo.mapList[ui_selectedMap.integer].mapLoadName ) );
}
}
@@ -3168,7 +3168,7 @@ static void UI_RunMenuScript( char **args )
{
if( ui_selectedMap.integer >= 0 && ui_selectedMap.integer < uiInfo.mapCount )
{
- trap_Cmd_ExecuteText( EXEC_APPEND, va( "callvote nextmap %s\n",
+ trap_Cmd_ExecuteText( EXEC_APPEND, va( "callvote nextmap \"%s\"\n",
uiInfo.mapList[ui_selectedMap.integer].mapLoadName ) );
}
}
@@ -3179,9 +3179,9 @@ static void UI_RunMenuScript( char **args )
char buffer[ MAX_CVAR_VALUE_STRING ];
trap_Cvar_VariableStringBuffer( "ui_reason", buffer, sizeof( buffer ) );
- trap_Cmd_ExecuteText( EXEC_APPEND, va( "callvote kick %d %s\n",
+ trap_Cmd_ExecuteText( EXEC_APPEND, va( "callvote kick %d%s\n",
uiInfo.clientNums[ uiInfo.playerIndex ],
- buffer ) );
+ ( buffer[ 0 ] ? va( " \"%s\"", buffer ) : "" ) ) );
trap_Cvar_Set( "ui_reason", "" );
}
}
@@ -3192,9 +3192,9 @@ static void UI_RunMenuScript( char **args )
char buffer[ MAX_CVAR_VALUE_STRING ];
trap_Cvar_VariableStringBuffer( "ui_reason", buffer, sizeof( buffer ) );
- trap_Cmd_ExecuteText( EXEC_APPEND, va( "callvote mute %d %s\n",
+ trap_Cmd_ExecuteText( EXEC_APPEND, va( "callvote mute %d%s\n",
uiInfo.clientNums[ uiInfo.playerIndex ],
- buffer ) );
+ ( buffer[ 0 ] ? va( " \"%s\"", buffer ) : "" ) ) );
trap_Cvar_Set( "ui_reason", "" );
}
}
@@ -3213,9 +3213,9 @@ static void UI_RunMenuScript( char **args )
char buffer[ MAX_CVAR_VALUE_STRING ];
trap_Cvar_VariableStringBuffer( "ui_reason", buffer, sizeof( buffer ) );
- trap_Cmd_ExecuteText( EXEC_APPEND, va( "callteamvote kick %d %s\n",
+ trap_Cmd_ExecuteText( EXEC_APPEND, va( "callteamvote kick %d%s\n",
uiInfo.teamClientNums[ uiInfo.teamPlayerIndex ],
- buffer ) );
+ ( buffer[ 0 ] ? va( " \"%s\"", buffer ) : "" ) ) );
trap_Cvar_Set( "ui_reason", "" );
}
}
@@ -3226,9 +3226,9 @@ static void UI_RunMenuScript( char **args )
char buffer[ MAX_CVAR_VALUE_STRING ];
trap_Cvar_VariableStringBuffer( "ui_reason", buffer, sizeof( buffer ) );
- trap_Cmd_ExecuteText( EXEC_APPEND, va( "callteamvote denybuild %d %s\n",
+ trap_Cmd_ExecuteText( EXEC_APPEND, va( "callteamvote denybuild %d%s\n",
uiInfo.teamClientNums[ uiInfo.teamPlayerIndex ],
- buffer ) );
+ ( buffer[ 0 ] ? va( " \"%s\"", buffer ) : "" ) ) );
trap_Cvar_Set( "ui_reason", "" );
}
}
diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c
index b027b513..1ba758ad 100644
--- a/src/ui/ui_shared.c
+++ b/src/ui/ui_shared.c
@@ -1840,7 +1840,7 @@ void Script_Exec( itemDef_t *item, char **args )
const char *val;
if( String_Parse( args, &val ) )
- DC->executeText( EXEC_APPEND, va( "%s ; ", val ) );
+ DC->executeText( EXEC_APPEND, va( "%s\n", val ) );
}
void Script_Play( itemDef_t *item, char **args )