Category Rework

The key thing here is that bad/onlyTargetCategories can take more than one category, which will allow us to use more intuitive categories. See IW, CA for examples.

Current Categories
AIR: All aircraft.
FLAG: Flags, mine signs.
BUILDING: Buildings.
DEPLOYED: Deployed guns and mgs.
INFANTRY: Infantry.
UNARMOURED SOFTVEH: Unarmored vehicles (i.e. trucks).
OPEN OPENVEH: Open-topped armored vehicles.
ARMOURED HARDVEH: Closed-top tanks.
SHIP: Ships.
SUB: Subs.
NONE: Nothing.
MINE: Mines.

MINETRIGGER: Units that trigger mines. Currently all mobile, non-flying, non-building units.

Basic conversion done. Please post if you have any comments/suggestions.

Found the culprit to targeting not working properly:

if (categories.find(name) == categories.end()) {
		if (name.find("ctrl") != std::string::npos
		 || name.find("arm") != std::string::npos
		 || name.find("core") != std::string::npos
		 || name.find("level") != std::string::npos
		 || name.find("energy") != std::string::npos
		 || name.find("storage") != std::string::npos
		 || name.find("defensive") != std::string::npos
		 || name.find("extractor") != std::string::npos
		 || name.find("metal") != std::string::npos
		 || name.find("torp") != std::string::npos)
			return 0;
		if(firstUnused > 31) {
			logOutput.Print("WARNING: too many unit categories %i missed %s", firstUnused + 1, name.c_str());
			return 0;

Since “ARMOURED” contains “ARM”…


Removed from engine :slight_smile:

Tobi is win.