From dc559bf6df2a0e293a5f68b6d8a6f8a6a3c638e2 Mon Sep 17 00:00:00 2001 From: Spoike Date: Fri, 1 Oct 2004 22:16:01 +0000 Subject: [PATCH] dedicated servers debugging is improved with this. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@279 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/textedit.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/engine/client/textedit.c b/engine/client/textedit.c index 9a71a5b05..4cc06dc5d 100644 --- a/engine/client/textedit.c +++ b/engine/client/textedit.c @@ -925,6 +925,33 @@ int QCLibEditor(char *filename, int line, int nump, char **parms) if (editormodal || !developer.value) return line; //whoops + if (!qrenderer) + { + int i; + char buffer[8192]; + char *r; + FILE *f; + + if (line == -1) + return -1; + COM_FOpenFile(filename, &f); + if (!f) + Con_Printf("%s - %i\n", filename, line); + else + { + for (i = 0; i < line; i++) + { + fgets(buffer, sizeof(buffer), f); + } + if ((r = strchr(buffer, '\r'))) + { r[0] = '\n';r[1]='\0';} + Con_Printf("%s", buffer); + fclose(f); + } + //PF_break(NULL); + return line; + } + if (!strncmp(OpenEditorFile, "src/", 4)) { if (!editoractive || strcmp(OpenEditorFile+4, filename))