From 035b3680e73f7828adf30f1a9c1771eba31df1dd Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 22 Feb 2017 12:56:25 +1000 Subject: [PATCH] Add an optional argument to the screenshot ent creation command which sets the path --- qcsrc/client/commands/cl_cmd.qc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qcsrc/client/commands/cl_cmd.qc b/qcsrc/client/commands/cl_cmd.qc index 0e4fad5294..6777eefa95 100644 --- a/qcsrc/client/commands/cl_cmd.qc +++ b/qcsrc/client/commands/cl_cmd.qc @@ -134,7 +134,8 @@ void LocalCommand_create_scrshot_ent(int request) { case CMD_REQUEST_COMMAND: { - string filename = strcat(MapInfo_Map_bspname, "_scrshot_ent.txt"); + string path = ((argv(1) == "") ? "" : strcat(argv(1), "/")); + string filename = strcat(path, MapInfo_Map_bspname, "_scrshot_ent.txt"); int fh = fopen(filename, FILE_APPEND); if (fh >= 0) @@ -145,7 +146,7 @@ void LocalCommand_create_scrshot_ent(int request) fputs(fh, strcat("\"angles\" \"", strcat(ftos(view_angles.x), " ", ftos(view_angles.y), " ", ftos(view_angles.z)), "\"\n")); fputs(fh, "}\n"); - LOG_INFO("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n"); + LOG_INFO("Completed screenshot entity dump in ^2data/data/", path, MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n"); fclose(fh); } @@ -159,8 +160,8 @@ void LocalCommand_create_scrshot_ent(int request) default: case CMD_REQUEST_USAGE: { - LOG_INFO("\nUsage:^3 cl_cmd create_scrshot_ent\n"); - LOG_INFO(" No arguments required.\n"); + LOG_INFO("\nUsage:^3 cl_cmd create_scrshot_ent [path]\n"); + LOG_INFO(" Where 'path' can be the subdirectory of data/data in which the file is saved.\n"); return; } } -- 2.39.2