From 5fffe5368a257423d6b23815c30ccbd1a411173f Mon Sep 17 00:00:00 2001 From: s1lentq Date: Wed, 4 Jan 2017 19:04:57 +0700 Subject: [PATCH] Fix: to get current mapname on first spawn (part 2) --- reapi/src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reapi/src/main.cpp b/reapi/src/main.cpp index 751e295..41ae4af 100644 --- a/reapi/src/main.cpp +++ b/reapi/src/main.cpp @@ -23,6 +23,10 @@ void OnAmxxAttach() // initialize API api_cfg.Init(); g_pEdicts = g_engfuncs.pfnPEntityOfEntIndex(0); + + // save true mapname + strncpy(g_szMapName, STRING(gpGlobals->mapname), sizeof(g_szMapName) - 1); + g_szMapName[sizeof(g_szMapName) - 1] = '\0'; } bool OnMetaAttach()