Page MenuHomeFeedback Tracker

count / select / configClasses don't access inherited classes
Assigned, WishlistPublic

Description

Whenever you inherit config entries to any config class, you will neither be able to count or select them nor will you be able to get them as array by configClasses.
To get a classes "true" entries, you'll need to loop thorough all inheritsFrom CONFIG, and so on, until all parents are looped.

In my understanding, inheriting from another config doesn't create a "true" copy but rather adds a reference.
It'd be nice to have select / count / configClasses access parents, too.

Details

Legacy ID
4125727515
Severity
None
Resolution
Open
Reproducibility
Always
Category
Config
Steps To Reproduce

In description.ext (or any config.cpp), add:

class parentclass {
value = 1;
text = "STRING";
};
class myclass : parentclass {};

Then try following in debug console:

count (missionconfigfile >> "myclass"); returns 0
"true" configClasses (missionconfigfile >> "myclass");
returns []
(missionconfigfile >> "myclass") select 0; // will lead into script error

Additional Information

EDIT:

As it turns out, this only applies to the class with the inheritance. This example works:

class parentclass {
value = 1;
text = "text";
class subclass {

		value = 2;
		text = "another text";

};
};
class myclass : parentclass {};

Now try:
count (missionconfigfile >> "myclass" >> "subclass"); //returns 2
and so on...

Event Timeline

Fett_Li edited Steps To Reproduce. (Show Details)Aug 28 2014, 12:24 PM
Fett_Li edited Additional Information. (Show Details)
Fett_Li set Category to Config.
Fett_Li set Reproducibility to Always.
Fett_Li set Severity to None.
Fett_Li set Resolution to Open.
Fett_Li set Legacy ID to 4125727515.May 7 2016, 7:19 PM
Fett_Li edited a custom field.