View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-13-2019 , 14:18   Re: ArrayList size difference
Reply With Quote #2

I'm surprised that ArrayList[MAXPLAYERS + 1] is even allowed as only dynamically sized array are supposed to support brackets after the type according to the docs.

i.e.

PHP Code:
ArrayList[] PlayerInfo = new ArrayList[MaxClients 1]; 
vs.
PHP Code:
ArrayList PlayerInfo[MAXPLAYERS 1]; 
Note that the first would only work inside a method, although you could split it into two parts, like so:

PHP Code:
ArrayList[] PlayerInfo;

//in a method such as OnMapStart
if (PlayerInfo != null)
    
delete PlayerInfo;

PlayerInfo = new ArrayList[MaxClients 1]; 
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-13-2019 at 14:24.
Powerlord is offline