In the OP API, the class tShipInfo contains a method called mGetClassType(). It is supposed to return an enumerated value of eClassTypes.
eg. eClassTypes fHullClass = Ship->mGetClassType();
The returned value, however, is incorrect in the OP API (although I believe it works normally in EAW).
Fortunately there is a fix for it. I have used the following function to 'restores' the value returned from above to its correct value.
eClassTypes mDebugGetClassType(eClassTypes hullclass)
{
switch(hullclass)
{
case kClassShuttle :
return kClassShuttle;
break;
case kClassPseudoFighter :
return kClassPseudoFighter;
break;
case kClassFreighter :
return kClassFreighter;
break;
case kClassFrigate :
return kClassCarrier;
break;
case kClassDestroyer :
return kClassFrigate;
break;
case kClassWarDestroyer :
return kClassDestroyer;
break;
case kClassLightCruiser :
return kClassWarDestroyer;
break;
case kClassHeavyCruiser :
return kClassLightCruiser;
break;
case kClassNewHeavyCruiser :
return kClassNewHeavyCruiser;
break;
case kClassHeavyBattlecruiser :
return kClassHeavyCruiser;
break;
case kClassCarrier :
return kClassHeavyBattlecruiser;
break;
case kClassDreadnought :
return kClassDreadnought;
break;
case kClassBattleship :
return kClassBattleship;
break;
case kClassListeningPost :
return kClassListeningPost;
break;
case kClassBaseStation :
return kClassBaseStation;
break;
case kClassBattleStation :
return kClassBattleStation;
break;
case kClassStarBase :
return kClassStarBase;
break;
case kClassMonster :
return kClassMonster;
break;
case kClassPlanets :
return kClassPlanets;
break;
case kClassSpecial :
return kClassSpecial;
break;
default :
return kClassShuttle;
break;
}
}
I have declared this as a global function simply by placing it into my CommonDefs.cpp file (with appropriate prototype in Commondefs.h) but it can be placed anywhere.
In the above example, the code would now look like this:
eClassTypes fHullClass = Ship->mGetClassType();
fHullClass = mDebugGetClassType(fHullClass);
The above function must be called whenever mGetClassType() is used (until we can correct the source code).
Feel free to use the above code.