Raised This Month: $51 Target: $400
 12% 

Solved Array-based enum structs will be removed in 1.11


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Qes
AlliedModders Donor
Join Date: Jul 2014
Old 04-14-2020 , 15:18   Array-based enum structs will be removed in 1.11
Reply With Quote #1

Hello
How I can update this code?

Warning: Array-based enum structs will be removed in 1.11
https://wiki.alliedmods.net/SourcePa...x#Enum_Structs

Code:
enum wQuest
{
	qACT,
	qValue,
	qTARGETS[5],
	qWEAPON,
	qAWARD[6],
	qTYPE
};
Example:
Code:
int QuestInfo[][wQuest] =
{
	{0,0,{0,0,0,0,0},0,{0,0,0,0,0,0},0},
	{1,1,{73,0,0,0,0},0,{0,0,70,0,0,0},4},
	{2,1,{23,3,5,0,0},0,{0,3,10,6,0,0},4},
	{3,1,{13,0,0,0,0},0,{0,0,50,0,0,0},4},
}
JoinedSenses,
Thank you very much.
"// In 1.10, need to set arraysize to 4 and initiaze each one by accessing members in a function like OnPluginStart" -> Ok

Last edited by Qes; 04-16-2020 at 07:55.
Qes is offline
JoinedSenses
Senior Member
Join Date: Sep 2013
Old 04-15-2020 , 11:23   Re: Array-based enum structs will be removed in 1.11
Reply With Quote #2

Code:
enum struct wQuest
{
	int qACT;
	int qValue;
	int qTARGETS[5];
	int qWEAPON;
	int qAWARD[6];
	int qTYPE;
};


// This only works in SM 1.11
// In 1.10, need to set arraysize to 4 and initiaze each one by accessing members in a function like OnPluginStart
wQuest QuestInfo[] =
{
	{0,0,{0,0,0,0,0},0,{0,0,0,0,0,0},0},
	{1,1,{73,0,0,0,0},0,{0,0,70,0,0,0},4},
	{2,1,{23,3,5,0,0},0,{0,3,10,6,0,0},4},
	{3,1,{13,0,0,0,0},0,{0,0,50,0,0,0},4},
}

// Access like this:
QuestInfo[index].qACT
QuestInfo[index].qAWARD
// ... etc
__________________

Last edited by JoinedSenses; 04-15-2020 at 11:24.
JoinedSenses is offline
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 11-11-2020 , 11:42   Re: Array-based enum structs will be removed in 1.11
Reply With Quote #3

Why you remove Array-based enum structs? More and more plugins not compiling against the newest sourcemod because .

I suggest to simply keep the warnings and therefore keep old plugins compliable.
fragnichtnach is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode