From 00ec666f183e9b31eb6fa502b515a70278e07a80 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 22 Oct 2007 07:54:04 +0000 Subject: [PATCH] sdktools' te dump command now uses mod dir instead of game dir --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401643 --- extensions/sdktools/tempents.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/extensions/sdktools/tempents.cpp b/extensions/sdktools/tempents.cpp index 3a07c31f..9660affa 100644 --- a/extensions/sdktools/tempents.cpp +++ b/extensions/sdktools/tempents.cpp @@ -62,14 +62,27 @@ CON_COMMAND(sm_dump_teprops, "Dumps tempentity props to a file") META_CONPRINT("Usage: sm_dump_teprops \n"); return; } + const char *arg = args.Arg(1); - FILE *fp = NULL; - if (!arg || arg[0] == '\0' || ((fp = fopen(arg, "wt")) == NULL)) + + if (!arg || arg[0] == '\0') { - META_CONPRINTF("Could not open file \"%s\"\n", arg); + META_CONPRINTF("Usage: sm_dump_teprops \n"); return; } + + char path[PLATFORM_MAX_PATH]; + g_pSM->BuildPath(Path_Game, path, sizeof(path), "%s", arg); + + FILE *fp = NULL; + if ((fp = fopen(path, "wt")) == NULL) + { + META_CONPRINTF("Could not open file \"%s\"\n", path); + return; + } + g_TEManager.DumpProps(fp); + fclose(fp); }