mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 14:25:38 +03:00
Fixed a backwards compatibility issue with free result
This commit is contained in:
parent
19f2be0c96
commit
f8809e2663
@ -8,7 +8,7 @@ void OnAmxxAttach()
|
|||||||
MF_AddNatives(g_BaseSqlNatives);
|
MF_AddNatives(g_BaseSqlNatives);
|
||||||
MF_AddNatives(g_ThreadSqlNatives);
|
MF_AddNatives(g_ThreadSqlNatives);
|
||||||
MF_RegisterFunction(&g_Mysql, "GetSqlDriver");
|
MF_RegisterFunction(&g_Mysql, "GetSqlDriver");
|
||||||
if (!MF_RequestFunction("GetDbDriver") || !MF_FindLibrary("SQLITE", LibType_Library))
|
if (!MF_RequestFunction("GetDbDriver") && !MF_FindLibrary("SQLITE", LibType_Library))
|
||||||
{
|
{
|
||||||
MF_AddNatives(g_OldCompatNatives);
|
MF_AddNatives(g_OldCompatNatives);
|
||||||
MF_AddLibraries("dbi", LibType_Class, &g_ident);
|
MF_AddLibraries("dbi", LibType_Class, &g_ident);
|
||||||
|
@ -327,6 +327,12 @@ static cell AMX_NATIVE_CALL dbi_free_result(AMX *amx, cell *params)
|
|||||||
{
|
{
|
||||||
cell *_r = MF_GetAmxAddr(amx, params[1]);
|
cell *_r = MF_GetAmxAddr(amx, params[1]);
|
||||||
cell num = *_r;
|
cell num = *_r;
|
||||||
|
|
||||||
|
if (!num)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
oldresult_s *oldrs = (oldresult_s *)GetHandle(num, Handle_OldResult);
|
oldresult_s *oldrs = (oldresult_s *)GetHandle(num, Handle_OldResult);
|
||||||
if (!oldrs)
|
if (!oldrs)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user