Quote:
Originally Posted by maqi
PHP Code:
public RoundStarted( )
{
ArrayClear( g_aOrigins ); // This is a clear btw :D
RetrieveOrigins( );
GetRandomOrigin( fOrigin );
}
|
Nice finding Sherlock, but that clear is executed before the functions.
Quote:
Originally Posted by Ghosted
Code:
new iRandomEntry = random_num( 0, ArraySize( g_aOrigins ) );
Code:
new iRandomEntry = random_num( 0, ArraySize( g_aOrigins ) - 1);
Plus Check if Array has any item.
if (!ArraySize(g_aOrigins))
return;
|
According to your logic, if ArraySize is 0, 0 - 1 = -1, which is incorrect.
If I check ArraySize, it will stop the error, but won't fix my problem.
__________________