View Single Post
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-21-2020 , 15:17   Re: ArrayPushArray return value bug?
Reply With Quote #2

If your claim is some native is broken don't show your code. Instead, create a minimal example that we can run and reproduce the issue.
If you suspect the code is the problem, then yes, show what you did.

PHP Code:
#include <amxmodx>

enum _:dummy
{
    
a,
    
b[10],
    
c
};

public 
plugin_init()
{
    new 
buffer[dummy];
    new Array:
test ArrayCreate(sizeof(buffer));
    
    new 
bool:ok true;
    for(new 
01000i++)
    {
        new 
position ArrayPushArray(testbuffer);
        if(
position != i)
        {
            
server_print("Wrong return value: %d != %d"iposition);
            
ok false;
            break;
        }
    }
    
    if(
ok)
    {
        
server_print("Return value is fine")
    }

Output:
Code:
Return value is fine
The native is not wrong.
__________________
HamletEagle is offline