From 261e135845db924089f9837b792737ff46f231d7 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Sat, 7 Feb 2015 09:21:53 -0800 Subject: [PATCH] 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; }