diff options
author | Tim Angus <tim@ngus.net> | 2004-11-30 23:05:20 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2004-11-30 23:05:20 +0000 |
commit | 8c4f8eaf275d8ab974e106d625a305440d16e1ee (patch) | |
tree | f6febb320de4d4a625d3e3f5d399b4fb9279a65c /src/ui | |
parent | 798ec438387193c4cf928ab36b59e982b194cf7a (diff) |
* PTRC (post timeout restoration code) system
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/ui_main.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 48de3dde..4eca5373 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -4208,6 +4208,27 @@ static void UI_RunMenuScript(char **args) { if( cmd = uiInfo.tremHumanBuildList[ uiInfo.tremHumanBuildIndex ].cmd ) trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); } + else if( Q_stricmp( name, "PTRCRestore" ) == 0 ) + { + int len; + char text[ 16 ]; + fileHandle_t f; + char command[ 32 ]; + + // load the file + len = trap_FS_FOpenFile( "ptrc.txt", &f, FS_READ ); + + if( len > 0 && ( len < sizeof( text ) - 1 ) ) + { + trap_FS_Read( text, len, f ); + text[ len ] = 0; + trap_FS_FCloseFile( f ); + + Com_sprintf( command, 32, "ptrcrestore %s", text ); + + trap_Cmd_ExecuteText( EXEC_APPEND, command ); + } + } //TA: tremulous menus else if (Q_stricmp(name, "playMovie") == 0) { |