View Single Post
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 06-12-2020 , 05:08   Re: Fix this > Array-based enum structs will be removed in 1.11.
Reply With Quote #2

https://wiki.alliedmods.net/SourcePa...x#Enum_Structs

There is a new syntax for this kind of data structure which you can switch to, but the way you're using it, as an index into an array of integers, allows for an easier change

PHP Code:
enum ListingRoles
{
    
Role_One 0,
    
Role_Two,
    
Role_Three,
    
Role_Four,
    
Role_Five,
    
Role_Six,
    
Role_Max
}

ListingRoles g_iRole[MAXPLAYERS 1]; //Stores information roles of each player

int g_iCounterRoles[Role_Max]; // <<< Warning on this line 
Instead of setting the whole ListingRoles enum as the array dimension, just add an additional "ending" element to the enum marking the maximum ordinal value of the enum and use that as the array dimension.
__________________
Peace-Maker is offline