fix for 45337 and some other little things

This commit is contained in:
David Anderson
2006-10-01 19:46:56 +00:00
parent f3057efd7d
commit fe1ebfe7bb
16 changed files with 141 additions and 47 deletions

View File

@ -382,13 +382,16 @@ static cell AMX_NATIVE_CALL SQL_FieldNumToName(AMX *amx, cell *params)
static cell AMX_NATIVE_CALL SQL_GetQueryString(AMX *amx, cell *params)
{
AmxQueryInfo *qInfo = (AmxQueryInfo *)GetHandle(params[1], Handle_Query);
if (!qInfo)
if (!qInfo || (!qInfo->pQuery && !qInfo->opt_ptr))
{
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid query handle: %d", params[1]);
return 0;
}
return MF_SetAmxString(amx, params[2], qInfo->pQuery->GetQueryString(), params[3]);
const char *ptr = qInfo->pQuery ? qInfo->pQuery->GetQueryString() : qInfo->opt_ptr;
return MF_SetAmxString(amx, params[2], ptr, params[3]);
}
static cell AMX_NATIVE_CALL SQL_FieldNameToNum(AMX *amx, cell *params)