diff --git a/src/zr/visualeffects/visualambience.inc b/src/zr/visualeffects/visualambience.inc index 56152e4..1594fd4 100644 --- a/src/zr/visualeffects/visualambience.inc +++ b/src/zr/visualeffects/visualambience.inc @@ -35,9 +35,6 @@ new String:g_VAmbienceDefaultSky[PLATFORM_MAX_PATH]; */ VAmbienceLoad() { - // Apply all visual effects now - VAmbienceApplyAll(); - // Find map's default sky. new Handle:hSkyname = FindConVar("sv_skyname"); if (hSkyname != INVALID_HANDLE) @@ -45,6 +42,13 @@ VAmbienceLoad() // Store map's default sky before applying new one. GetConVarString(hSkyname, g_VAmbienceDefaultSky, sizeof(g_VAmbienceDefaultSky)); } + else + { + LogEvent(false, LogType_Error, LOG_CORE_EVENTS, LogModule_VEffects, "Sky Caching", "Couldn't find handle to cvar: \"sv_skyname\""); + } + + // Apply all visual effects now + VAmbienceApplyAll(); // If sky is disabled, then stop. new bool:sky = GetConVarBool(g_hCvarsList[CVAR_VEFFECTS_SKY]); @@ -246,6 +250,7 @@ VAmbienceApplySky(bool:disable = false) // If default, then set to default sky. if (disable) { + PrintToServer("+===============+++++ %s", g_VAmbienceDefaultSky); if (g_VAmbienceDefaultSky[0]) { SetConVarString(hSkyname, g_VAmbienceDefaultSky, true); diff --git a/src/zr/weapons/zmarket.inc b/src/zr/weapons/zmarket.inc index b227aa4..c772d28 100644 --- a/src/zr/weapons/zmarket.inc +++ b/src/zr/weapons/zmarket.inc @@ -114,7 +114,12 @@ ZMarketClientInit(client) ZMarketOnClientDisconnect(client) { // Destroy ZMarket array data for client. - CloseHandle(g_hZMarketPurchaseCount[client]); + if (g_hZMarketPurchaseCount[client] != INVALID_HANDLE) + { + CloseHandle(g_hZMarketPurchaseCount[client]); + } + + // Reset handle. g_hZMarketPurchaseCount[client] = INVALID_HANDLE; }