added amb1425, added description buffers to find concommand natives
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401899
This commit is contained in:
@@ -1136,6 +1136,7 @@ static cell_t FindFirstConCommand(IPluginContext *pContext, const cell_t *params
|
||||
ConCmdIter *pIter;
|
||||
cell_t *pIsCmd, *pFlags;
|
||||
const ConCommandBase *pConCmd;
|
||||
const char *desc;
|
||||
|
||||
pContext->LocalToPhysAddr(params[3], &pIsCmd);
|
||||
pContext->LocalToPhysAddr(params[4], &pFlags);
|
||||
@@ -1151,6 +1152,12 @@ static cell_t FindFirstConCommand(IPluginContext *pContext, const cell_t *params
|
||||
*pIsCmd = pConCmd->IsCommand() ? 1 : 0;
|
||||
*pFlags = pConCmd->GetFlags();
|
||||
|
||||
if (params[6])
|
||||
{
|
||||
desc = pConCmd->GetHelpText();
|
||||
pContext->StringToLocalUTF8(params[5], params[6], (desc && desc[0]) ? desc : "", NULL);
|
||||
}
|
||||
|
||||
pIter = new ConCmdIter;
|
||||
pIter->pLast = pConCmd;
|
||||
|
||||
@@ -1169,6 +1176,7 @@ static cell_t FindNextConCommand(IPluginContext *pContext, const cell_t *params)
|
||||
HandleError err;
|
||||
ConCmdIter *pIter;
|
||||
cell_t *pIsCmd, *pFlags;
|
||||
const char *desc;
|
||||
HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
|
||||
|
||||
if ((err = g_HandleSys.ReadHandle(params[1], htConCmdIter, &sec, (void **)&pIter)) != HandleError_None)
|
||||
@@ -1193,6 +1201,12 @@ static cell_t FindNextConCommand(IPluginContext *pContext, const cell_t *params)
|
||||
*pIsCmd = pIter->pLast->IsCommand() ? 1 : 0;
|
||||
*pFlags = pIter->pLast->GetFlags();
|
||||
|
||||
if (params[7])
|
||||
{
|
||||
desc = pIter->pLast->GetHelpText();
|
||||
pContext->StringToLocalUTF8(params[6], params[7], (desc && desc[0]) ? desc : "", NULL);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user