CvUnitInfo and isMechanized()

Shqype

Shqyptar
Joined
Nov 15, 2005
Messages
2,468
Location
New York + Shqypni
I noticed that in CvUnit.cpp and CvUnit.h (as well as the Cy files), there is no reference to "isMechanized," the tag that appears in the XML for a unit.

I tried to "expose" this tag to those files, by following the same format used for "isAnimal()" , declaring it a bool, etc. But, when I compile the DLL, I get an error that CvUnitInfo does not have "isMechanized()."

What am I missing here? Why isn't this a part of the CvUnit.cpp file to begin with? And could anyone perhaps point me in the right direction if I wanted to add completely new variables and tags to such files?
 
I searched through the code, and found the answer, for anyone interested:

Instead of "isMechanized" as I originally thought, "isMechUnit()" is used. This should help anyone interested in checking whether a unit is Mechanized or not.
 
Just FYI, the mechanized tag doesn't do anything. This was probably intended for something originally and they abandoned it and never bothered to remove the tag. But it's good though because then people can use it for whatever they want.
 
Just FYI, the mechanized tag doesn't do anything. This was probably intended for something originally and they abandoned it and never bothered to remove the tag. But it's good though because then people can use it for whatever they want.

I know, I had to declare the bool myself, but I used it for a specific purpose that I'll later be releasing a modcomp for ;)
 
There is no pUnit.isMechinized(), it is gc.getUnitInfo(pUnit.getUnitType()).isMechanized(). So I beleive isMechinized should be in CvInfos.cpp under UnitInfo.
 
Back
Top Bottom