Fixed error in zmarket caused by disconnection twice before the client was put in game (rapid map changing), fixed sky not disabling properly.
This commit is contained in:
parent
1530d20308
commit
f403485b38
@ -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);
|
||||
|
@ -114,7 +114,12 @@ ZMarketClientInit(client)
|
||||
ZMarketOnClientDisconnect(client)
|
||||
{
|
||||
// Destroy ZMarket array data for client.
|
||||
if (g_hZMarketPurchaseCount[client] != INVALID_HANDLE)
|
||||
{
|
||||
CloseHandle(g_hZMarketPurchaseCount[client]);
|
||||
}
|
||||
|
||||
// Reset handle.
|
||||
g_hZMarketPurchaseCount[client] = INVALID_HANDLE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user