From: Mario Date: Wed, 22 Feb 2017 02:56:25 +0000 (+1000) Subject: Add an optional argument to the screenshot ent creation command which sets the path X-Git-Tag: xonotic-v0.8.2~185 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=035b3680e73f7828adf30f1a9c1771eba31df1dd;p=xonotic%2Fxonotic-data.pk3dir.git Add an optional argument to the screenshot ent creation command which sets the path --- diff --git a/qcsrc/client/commands/cl_cmd.qc b/qcsrc/client/commands/cl_cmd.qc index 0e4fad529..6777eefa9 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; } }