j_mie6
Deity
Hello!
If been working on some tech enhancements for the Babylon 5 mod, and I have some code that doesn't work, and I can't figure out why, I was hoping somebody could shed some light on the logic here:
Above code placed at the start of CvPlayer::canEverResearch(). if the tech is disabled, it should check to see if the tech requires a civ to be met (that isn't minor, barbarian or player). If there is a place met allow them to research the tech.
the problem is, the tech is available even if you haven't found anybody yet!
here is some code from the snip section which is similar and does work, but it is enabled having discovered ALL other civs
can anybody tell me what I am doing wrong here? I have to have the tech disabled by the way...
Thanks,
Jamie
If been working on some tech enhancements for the Babylon 5 mod, and I have some code that doesn't work, and I can't figure out why, I was hoping somebody could shed some light on the logic here:
Code:
//Babylon 5 Mod - Tech Enhancements - Start
if (GC.getTechInfo(eTech).isDisable())
{
if (GC.getTechInfo(eTech).isRequiresMetCiv())
{
for (int i = 0; i < GC.getGameINLINE().countCivTeamsEverAlive(); i++)
{
if (getTeam() == (TeamTypes) i ||
GET_TEAM((TeamTypes) i).isMinorCiv() ||
GET_TEAM((TeamTypes) i).isBarbarian())
{
continue;
}
if (GET_TEAM(getTeam()).isHasMet((TeamTypes) i))
{
break;
}
}
}
/* snip */
else
{
return false;
}
}
//Babylon 5 Mod - Tech Enhancements - End
Above code placed at the start of CvPlayer::canEverResearch(). if the tech is disabled, it should check to see if the tech requires a civ to be met (that isn't minor, barbarian or player). If there is a place met allow them to research the tech.
the problem is, the tech is available even if you haven't found anybody yet!
here is some code from the snip section which is similar and does work, but it is enabled having discovered ALL other civs
Code:
else if (GC.getTechInfo(eTech).isRequiresMetAllCivs())
{
for (int i = 0; i < GC.getGameINLINE().countCivTeamsEverAlive(); i++)
{
if (getTeam() == (TeamTypes) i ||
GET_TEAM((TeamTypes) i).isMinorCiv() ||
GET_TEAM((TeamTypes) i).isBarbarian() ||
!GET_TEAM((TeamTypes) i).isAlive())
{
continue;
}
if (!GET_TEAM(getTeam()).isHasMet((TeamTypes) i))
{
return false;
}
}
}
can anybody tell me what I am doing wrong here? I have to have the tech disabled by the way...
Thanks,
Jamie