View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-26-2018 , 16:20   Re: Enum Structs Available This Holiday Season
Reply With Quote #14

Quote:
Originally Posted by LeToucan View Post
So since enum structs are treated as an array, when using array fields they are treated as 2 dimensional arrays, and thus wouldn't correctly work with ArrayLists? The section outlining using them with ArrayLists could be updated, as this part makes it seem like my snippet should work.
While I can't say I know how Pawn internally treats 2-dimensional arrays, in this case you're storing an array reference nside another array.

It helps if you know arrays are a reference type. When I say that, I mean when you do this:

PHP Code:
int players[MAXPLAYERS+1]; 
you're actually creating an array with a length of MAXPLAYERS+1, then storing the memory address of the start of that array in players
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 12-26-2018 at 16:20. Reason: +words
Powerlord is offline