From 261e135845db924089f9837b792737ff46f231d7 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Sat, 7 Feb 2015 09:21:53 -0800 Subject: [PATCH 1/2] Make handle dump location relative to gamedir to match other sm_dump commands. --- core/sm_srvcmds.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/sm_srvcmds.cpp b/core/sm_srvcmds.cpp index cf9355e2..2fcbae6e 100644 --- a/core/sm_srvcmds.cpp +++ b/core/sm_srvcmds.cpp @@ -397,11 +397,14 @@ CON_COMMAND(sm_dump_handles, "Dumps Handle usage to a file for finding Handle le if (strcmp(args.Arg(1), "log") != 0) { + char filename[PLATFORM_MAX_PATH]; const char *arg = args.Arg(1); - FILE *fp = fopen(arg, "wt"); + g_SourceMod.BuildPath(Path_SM, filename, sizeof(filename), "%s", arg); + + FILE *fp = fopen(filename, "wt"); if (!fp) { - g_RootMenu.ConsolePrint("Could not find file \"%s\"", arg); + g_RootMenu.ConsolePrint("Failed to open \"%s\" for writing", filename); return; } From 00ad38f5b7727a5a85d7a502fc5dc45bbf32cd7e Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Sat, 7 Feb 2015 09:25:25 -0800 Subject: [PATCH 2/2] Actually use game path instead of SM path as base. --- core/sm_srvcmds.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/sm_srvcmds.cpp b/core/sm_srvcmds.cpp index 2fcbae6e..0836798c 100644 --- a/core/sm_srvcmds.cpp +++ b/core/sm_srvcmds.cpp @@ -399,7 +399,7 @@ CON_COMMAND(sm_dump_handles, "Dumps Handle usage to a file for finding Handle le { char filename[PLATFORM_MAX_PATH]; const char *arg = args.Arg(1); - g_SourceMod.BuildPath(Path_SM, filename, sizeof(filename), "%s", arg); + g_SourceMod.BuildPath(Path_Game, filename, sizeof(filename), "%s", arg); FILE *fp = fopen(filename, "wt"); if (!fp)