continue enums in subclasses

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

continue enums in subclasses

Post by Sir Robin »

this is a pretty minor thing and easy to work around, but it would be nice if enums continued in subclasses

Code: Select all

class test : inventory
{
	enum MyEnum
	{
		MY_First,
		MY_Second
	}
	
	default {+inventory.invbar;inventory.icon "UNKNA0";}
	states {spawn:UNKN A -1;stop;}

	override bool use(bool pickup)
	{
		console.printf("first:  "..MY_First);
		console.printf("second: "..MY_Second);
		return false;
	}
}

class test1 : test
{
	enum MyEnum
	{
		MY_Third,
		MY_Fourth
	}
	override bool use(bool pickup)
	{
		super.use(pickup);
		console.printf("third:  "..MY_Third);
		console.printf("fourth: "..MY_Fourth);
		return false;
	}
}
it would be nice if test1.MY_Third==2 but it restarts at 0

Return to “Feature Suggestions [GZDoom]”