xienwolf
Deity
What kind of crash are you getting with that function? Pretty basic (ie - fundamental, not simple) function there which impacts a LOT of the code. But also looks absolutely unchanged to me.
O_o good point. The units shall still stay in the game but they should not be buildable anymore. Maybe I really should use maxerastart instead?
bool CvPlayer::canTrain(UnitTypes eUnit, bool bContinue, bool bTestVisible, bool bIgnoreCost) const
{
PROFILE_FUNC();
...
if (GC.getUnitInfo(eUnit).getMaxStartEra() != NO_ERA)
{
if (GC.getGameINLINE().getStartEra() > GC.getUnitInfo(eUnit).getMaxStartEra())
{
return false;
}
}
bool CvPlayer::canTrain(UnitTypes eUnit, bool bContinue, bool bTestVisible, bool bIgnoreCost) const
{
PROFILE_FUNC();
...
if (GC.getUnitInfo(eUnit).getObsoleteTech() != NO_TECH)
{
if ((GET_TEAM(getTeam()).isHasTech((TechTypes)(GC.getUnitInfo(eUnit).getObsoleteTech()))))
{
return false;
}
}
bool bContinue, bool bTestVisible, bool bIgnoreCost
bool CvPlayer::canTrain(UnitTypes eUnit) const
What is the point of PROFILE_FUNC()?
damn... one thing just came in my mind:
for the maceman/grenadier/rifleman problem we would need TWO obselete techs: military_science and rifling.
Xienwolf in the canTrain function:
bool CvPlayer::canTrain(UnitTypes eUnit, bool bContinue, bool bTestVisible, bool bIgnoreCost) const
What is the point of these identifiers?:
Why can't we just say:Code:bool bContinue, bool bTestVisible, bool bIgnoreCost
?Code:bool CvPlayer::canTrain(UnitTypes eUnit) const