Skip to content

Commit c29ea28

Browse files
azaltynuclearsilo583
authored andcommitted
Small improvements to OnConfigExecuted
1 parent 5776364 commit c29ea28

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

addons/sourcemod/scripting/store_item_cpsupport.sp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public Plugin myinfo =
5454
name = "Store - Chat Processor item module with Scoreboard Tag",
5555
author = "nuclear silo, Mesharsky, AiDN™",
5656
description = "Chat Processor item module by nuclear silo, the Scoreboard Tag for Zephyrus's by Mesharksy, for nuclear silo's edited store by AiDN™",
57-
version = "2.7",
57+
version = "2.8",
5858
url = ""
5959
};
6060

@@ -213,18 +213,13 @@ public Action Command_TGS(int client, int args)
213213
}
214214

215215
public void Store_OnConfigExecuted(char[] prefix)
216-
{
217-
// If it's already connected we are good to go
218-
if(g_hDatabase != INVALID_HANDLE)
219-
return;
220-
221-
g_cvDatabaseEntry = FindConVar("sm_store_database");
222-
216+
{
223217
strcopy(g_sChatPrefix, sizeof(g_sChatPrefix), prefix);
224218

225-
if(FileEnable)
219+
if(FileEnable && !g_hDatabase)
226220
{
227221
char buffer[128];
222+
g_cvDatabaseEntry = FindConVar("sm_store_database");
228223
g_cvDatabaseEntry.GetString(buffer, 128);
229224
SQL_TConnect(SQLCallback_Connect, buffer);
230225
}

addons/sourcemod/scripting/store_misc_voucher.sp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public Plugin myinfo =
5454
name = "Store - Voucher module",
5555
author = "shanapu, nuclear silo", // If you should change the code, even for your private use, please PLEASE add your name to the author here
5656
description = "",
57-
version = "2.0", // If you should change the code, even for your private use, please PLEASE make a mark here at the version number
57+
version = "2.1", // If you should change the code, even for your private use, please PLEASE make a mark here at the version number
5858
url = ""
5959
};
6060

@@ -98,19 +98,17 @@ public void OnAllPluginsLoaded()
9898

9999
public void Store_OnConfigExecuted(char[] prefix)
100100
{
101-
// If it's already connected we are good to go
102-
if(g_hDatabase != INVALID_HANDLE)
103-
return;
104-
105101
strcopy(g_sChatPrefix, sizeof(g_sChatPrefix), prefix);
106102

107103
ReadCoreCFG();
108104

109-
g_cvDatabaseEntry = FindConVar("sm_store_database");
110-
char buffer[128];
111-
g_cvDatabaseEntry.GetString(buffer, 128);
112-
SQL_TConnect(SQLCallback_Connect, buffer);
113-
105+
if (!g_hDatabase) // If it's already connected we are good to go
106+
{
107+
g_cvDatabaseEntry = FindConVar("sm_store_database");
108+
char buffer[128];
109+
g_cvDatabaseEntry.GetString(buffer, 128);
110+
SQL_TConnect(SQLCallback_Connect, buffer);
111+
}
114112
}
115113

116114
public void SQLCallback_Connect(Handle owner, Handle hndl, const char[] error, any data)

0 commit comments

Comments
 (0)