void demoAutoSave_f(void) { int t = 0; if (strstr(cl_autoDemoFormat->string, "%t")) while (demo.record.timeStamps[t] && t < MAX_TIMESTAMPS) t++; demo.record.timeStamps[t] = cl.serverTime - atoi(cl.gameState.stringData + cl.gameState.stringOffsets[CS_LEVEL_START_TIME]); if (!(Cmd_Argc() < 2)) { Q_strncpyz(demo.record.customName, Cmd_Argv( 1 ), sizeof(demo.record.customName)); } Com_sprintf(demo.record.demoName, sizeof(demo.record.demoName), demoAutoFormat(demo.record.customName)); Com_Printf(S_COLOR_WHITE"Demo will be saved into "S_COLOR_GREEN"%s.dm_26\n", demo.record.demoName); }
void demoAutoSave_f(void) { int t = 0; if (cls.state != CA_ACTIVE) { Com_Printf ("You must be in a level to save the demo.\n"); return; } if (strstr(cl_autoDemoFormat->string, "%t")) while (demoAuto.timeStamps[t] && t < MAX_TIMESTAMPS) t++; demoAuto.timeStamps[t] = cl.serverTime - atoi(cl.gameState.stringData + cl.gameState.stringOffsets[CS_LEVEL_START_TIME]); if (!(Cmd_Argc() < 2)) { Q_strncpyz(demoAuto.customName, Cmd_Argv( 1 ), sizeof(demoAuto.customName)); } Com_sprintf(demoAuto.demoName, sizeof(demoAuto.demoName), "%s", demoAutoFormat(demoAuto.customName)); Com_Printf(S_COLOR_WHITE "Demo will be saved into " S_COLOR_GREEN "%s%s\n", demoAuto.demoName, demoAuto.ext); }