More conversion
This commit is contained in:
+13
-12
@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
|
||||
#include "quakedef.hpp"
|
||||
|
||||
@@ -202,7 +203,7 @@ stop recording a demo
|
||||
*/
|
||||
void CL_Stop_f (void)
|
||||
{
|
||||
if (cmd_source != src_command)
|
||||
if (command::last_source != command::source::command)
|
||||
return;
|
||||
|
||||
if (!cls.demorecording)
|
||||
@@ -239,7 +240,7 @@ void CL_Record_f (void)
|
||||
char name[MAX_OSPATH];
|
||||
int track;
|
||||
|
||||
if (cmd_source != src_command)
|
||||
if (command::last_source != command::source::command)
|
||||
return;
|
||||
|
||||
if (cls.demoplayback)
|
||||
@@ -251,14 +252,14 @@ void CL_Record_f (void)
|
||||
if (cls.demorecording)
|
||||
CL_Stop_f();
|
||||
|
||||
c = Cmd_Argc();
|
||||
c = command::argc();
|
||||
if (c != 2 && c != 3 && c != 4)
|
||||
{
|
||||
Con_Printf ("record <demoname> [<map> [cd track]]\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (strstr(Cmd_Argv(1), ".."))
|
||||
if (strstr(command::argv(1).value_or("").c_str(), ".."))
|
||||
{
|
||||
Con_Printf ("Relative pathnames are not allowed.\n");
|
||||
return;
|
||||
@@ -280,7 +281,7 @@ void CL_Record_f (void)
|
||||
// write the forced cd track number, or -1
|
||||
if (c == 4)
|
||||
{
|
||||
track = atoi(Cmd_Argv(3));
|
||||
track = atoi(command::argv(3)->c_str());
|
||||
Con_Printf ("Forcing CD track to %i\n", cls.forcetrack);
|
||||
}
|
||||
else
|
||||
@@ -288,12 +289,12 @@ void CL_Record_f (void)
|
||||
track = -1;
|
||||
}
|
||||
|
||||
q_snprintf (name, sizeof(name), "%s/%s", com_gamedir, Cmd_Argv(1));
|
||||
q_snprintf (name, sizeof(name), "%s/%s", com_gamedir, command::argv(1).value_or("").c_str());
|
||||
|
||||
// start the map up
|
||||
if (c > 2)
|
||||
{
|
||||
Cmd_ExecuteString ( va("map %s", Cmd_Argv(2)), src_command);
|
||||
command::execute_string ( std::format("map {:s}", *command::argv(2)), command::source::command);
|
||||
if (cls.state != ca_connected)
|
||||
return;
|
||||
}
|
||||
@@ -403,10 +404,10 @@ void CL_PlayDemo_f (void)
|
||||
{
|
||||
char name[MAX_OSPATH];
|
||||
|
||||
if (cmd_source != src_command)
|
||||
if (command::last_source != command::source::command)
|
||||
return;
|
||||
|
||||
if (Cmd_Argc() != 2)
|
||||
if (command::argc() != 2)
|
||||
{
|
||||
Con_Printf ("playdemo <demoname> : plays a demo\n");
|
||||
return;
|
||||
@@ -416,7 +417,7 @@ void CL_PlayDemo_f (void)
|
||||
CL_Disconnect ();
|
||||
|
||||
// open the demo file
|
||||
std::strncpy(name, Cmd_Argv(1), sizeof(name));
|
||||
std::strncpy(name, command::argv(1).value_or("").c_str(), sizeof(name));
|
||||
COM_AddExtension (name, ".dem", sizeof(name));
|
||||
|
||||
Con_Printf ("Playing demo from %s.\n", name);
|
||||
@@ -480,10 +481,10 @@ timedemo [demoname]
|
||||
*/
|
||||
void CL_TimeDemo_f (void)
|
||||
{
|
||||
if (cmd_source != src_command)
|
||||
if (command::last_source != command::source::command)
|
||||
return;
|
||||
|
||||
if (Cmd_Argc() != 2)
|
||||
if (command::argc() != 2)
|
||||
{
|
||||
Con_Printf ("timedemo <demoname> : gets demo speeds\n");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user