Raised This Month: $ Target: $400
 0% 

Solved Invalid cellvector handle


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-23-2018 , 07:57   Re: Invalid cellvector handle
Reply With Quote #7

Quote:
Originally Posted by maqi View Post
I think you are wrong. It's always the same error, where the first parameter indicates the handle id, the second index to get and the third size of the array, as the size is 0, there is nothing to get, therefor the error.

Code:
// ArrayGetArray(Array:which, item, any:output[]);
static cell AMX_NATIVE_CALL ArrayGetArray(AMX* amx, cell* params)
{
	CellVector* vec=HandleToVector(amx, params[1]);

	if (vec==NULL)
	{
		return 0;
	}

	if (vec->GetArray(params[2],get_amxaddr(amx, params[3]))!=1)
	{
		LogError(amx, AMX_ERR_NATIVE, "Invalid cellvector handle provided (%d:%d:%d)", params[1], params[2], vec->Size());
		return 0;
	}

	return 1;
}
Um, where did you even find that? The code in github is completelly different:

PHP Code:
// native ArrayGetArray(Array:which, item, any:output[], size = -1);
static cell AMX_NATIVE_CALL ArrayGetArray(AMXamxcellparams)
{
    
CellArrayvec ArrayHandles.lookup(params[1]);

    if (!
vec)
    {
        
LogError(amxAMX_ERR_NATIVE"Invalid array handle provided (%d)"params[1]);
        return 
0;
    }

    
size_t idx = (size_t)params[2];

    if (
idx >= vec->size())
    {
        
LogError(amxAMX_ERR_NATIVE"Invalid index %d (count: %d)"idxvec->size());
        return 
0;
    }

    
cell *blk vec->at(idx);
    
size_t indexes vec->blocksize();

    if (*
params sizeof(cell) == 4)
    {
        if (
params[4] != -&& (size_t)params[4] <= vec->blocksize())
        {
            
indexes params[4];
        }
    }

    
cell *addr get_amxaddr(amxparams[3]);

    
memcpy(addrblksizeof(cell) * indexes);

    return 
indexes;

I assume it's much different in 1.8.2.
__________________

Last edited by OciXCrom; 07-23-2018 at 07:58.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode