Skip to content

Commit b7e969c

Browse files
committed
Some bugfixes
1 parent 1407283 commit b7e969c

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

build_win32.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
cd bin
33

44
echo Compile...
5-
gcc -O3 -Wformat -I../mysql/windows/include -c ../*.c
5+
gcc -O3 -Wall -I../mysql/windows/include -c ../*.c
66

77
echo Link...
88
gcc -O3 -shared -o cod4x_mysql.dll *.o ../mysql/windows/lib/libmysql.lib ../../libcom_plugin.a

plugin_main.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#define PLUGIN_NAME "CoD4X MySQL Plugin"
2020
#define PLUGIN_DESCR PLUGIN_NAME" allows you to query information from " \
21-
"mysql database. MySQL version: %d"
21+
"mysql database. MySQL version: %lu"
2222
#define PLUGIN_SHORT PLUGIN_NAME" by Sharpienero, MichaelHillcox, T-Max"
2323

2424
/* Globals */
@@ -68,12 +68,15 @@ PCL int OnInit()
6868
{
6969
if (mysql_init(&g_mysql[i]) == NULL)
7070
{
71-
Plugin_PrintError("MySQL plugin initialization[%d] failed: (%d) %s",
72-
i, mysql_errno(&mysql), mysql_error(&mysql));
71+
Plugin_PrintError("MySQL plugin initialization[%d] failed: "
72+
"(%d) %s", i, mysql_errno(&g_mysql[i]),
73+
mysql_error(&g_mysql[i]));
7374
}
7475
g_mysql_res[i] = NULL;
7576
++i;
7677
}
78+
79+
return 0;
7780
}
7881

7982
PCL void OnTerminate()

script_functions.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static void Scr_MySQL_CheckConnection(int handle)
5454
static void Scr_MySQL_CheckQuery(int handle)
5555
{
5656
/* Attempt to call without query */
57-
if (mysql_res[handle] == NULL)
57+
if (g_mysql_res[handle] == NULL)
5858
{
5959
Plugin_Scr_Error("'mysql_query' must be called before.");
6060
}
@@ -199,7 +199,7 @@ void Scr_MySQL_Close_f()
199199
g_mysql_res[handle] = NULL;
200200
}
201201
mysql_close(&g_mysql[handle]);
202-
g_mysql_reserved[handle] = false;
202+
g_mysql_reserved[handle] = qfalse;
203203
}
204204

205205
/* =================================================================
@@ -232,7 +232,7 @@ void Scr_MySQL_Affected_Rows_f()
232232
int handle = Scr_MySQL_GetHandle(0);
233233
Scr_MySQL_CheckCall(handle);
234234

235-
Plugin_Scr_AddInt(mysql_affected_rows(&mysql));
235+
Plugin_Scr_AddInt(mysql_affected_rows(&g_mysql[handle]));
236236
}
237237

238238
/* =================================================================

0 commit comments

Comments
 (0)