summaryrefslogtreecommitdiff
path: root/source/common.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2007-12-14 23:30:31 +0000
committerAndrey Nazarov <skuller@skuller.net>2007-12-14 23:30:31 +0000
commita21868632c585f33742f7e295aafad36a436cdd9 (patch)
tree91d01192835662109845c2f9fd4d840d842e2b47 /source/common.c
parent0ec5f1b7a5689865d6cd10daa17883201766dc6a (diff)
Distinguish left and right SHIFT, CTRL, ALT modifiers.
Take SHIFT modifier into account when executing key bindings. Added `text' command which just stuffs its arguments into the command buffer for further macro expansion. Made sure $$ escaping works.
Diffstat (limited to 'source/common.c')
-rw-r--r--source/common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/common.c b/source/common.c
index 84022e7..7e545b6 100644
--- a/source/common.c
+++ b/source/common.c
@@ -1097,6 +1097,10 @@ int Com_Uptime_m( char *buffer, int size ) {
return Com_sprintf( buffer, size, "%02d.%02d", min, sec );
}
+int Com_Random_m( char *buffer, int size ) {
+ return Com_sprintf( buffer, size, "%d", rand() % 10 );
+}
+
static void Com_LastError_f( void ) {
if( com_errorMsg[0] ) {
Com_Printf( "%s\n", com_errorMsg );
@@ -1451,6 +1455,7 @@ void Qcommon_Init( int argc, char **argv ) {
Cmd_AddMacro( "com_date", Com_Date_m );
Cmd_AddMacro( "com_time", Com_Time_m );
Cmd_AddMacro( "com_uptime", Com_Uptime_m );
+ Cmd_AddMacro( "random", Com_Random_m );
// add any system-wide configuration files
Sys_AddDefaultConfig();