From 99c6152b4e60b81db95e0f709bef396507ae677f Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 13 Oct 2008 09:25:51 +0000 Subject: [PATCH] Support for DP_SV_SPAWNFUNC_PREFIX in the .ent/bspent loader thingie. I'll add the extension name when I get around to fixing up and committing that chunk of code. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3044 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/pr_edict.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/qclib/pr_edict.c b/engine/qclib/pr_edict.c index f831e9d6e..392a14357 100644 --- a/engine/qclib/pr_edict.c +++ b/engine/qclib/pr_edict.c @@ -2040,7 +2040,13 @@ int LoadEnts(progfuncs_t *progfuncs, char *file, float killonspawnflags) //DP_SV_SPAWNFUNC_PREFIX support eclassname = PR_StringToNative(progfuncs, var->string); - f = PR_FindFunc(progfuncs, va("spawnfunc_%s", eclassname), PR_ANYBACK); +#ifdef _WIN32 + _snprintf(filename, sizeof(filename), "spawnfunc_%s", eclassname); + filename[sizeof(filename)-1] = 0; +#else + snprintf(filename, sizeof(filename), "spawnfunc_%s", eclassname); +#endif + f = PR_FindFunc(progfuncs, filename, PR_ANYBACK); if (!f) f = PR_FindFunc(progfuncs, eclassname, PR_ANYBACK); if (f)