Misotu
Mar 21, 2007, 02:25 PM
Well, this has probably come up somewhere else, but I couldn't find it. When I regenerate future maps, I lose the ability to see the entire map. Is this fixable, or do I just have to live with it? I don't mind not being able to use mapfinder, although that would be helpful. But I really mind having to sit there re-entering my choices of opposing civs every time - or taking the worst the game can throw at me because I'm too lazy to do it the long way ... :cry:
superslug
Mar 21, 2007, 04:31 PM
Is this fixable, or do I just have to live with it?
If we knew a way to mod that out, we probably would. ;)
ori
Mar 22, 2007, 07:48 AM
If we knew a way to mod that out, we probably would. ;)
As you asked so nicely :p
Add the bolded code to CvGame.cpp - notice this is messy coding, since it forces a loop through all Techs just to reset Satelites, but it works (play tested it twice :rolleyes:) this might make regenerating a bit longer, though since it is done while regenerating the map...
void CvGame::initFreeState()
{
bool bValid;
int iI, iJ, iK;
for (iI = 0; iI < GC.getNumTechInfos(); iI++)
{
for (iJ = 0; iJ < MAX_TEAMS; iJ++)
{
if (GET_TEAM((TeamTypes)iJ).isAlive())
{
bValid = false;
GET_TEAM((TeamTypes)iJ).setHasTech(((TechTypes)iI) , bValid, NO_PLAYER, false, false);
}
}
}
for (iI = 0; iI < GC.getNumTechInfos(); iI++)
{
for (iJ = 0; iJ < MAX_TEAMS; iJ++)
{
if (GET_TEAM((TeamTypes)iJ).isAlive())
{
bValid = false;
if (!bValid)
{
if ((GC.getHandicapInfo(getHandicapType()).isFreeTech s(iI)) ||
(!(GET_TEAM((TeamTypes)iJ).isHuman())&& GC.getHandicapInfo(getHandicapType()).isAIFreeTech s(iI)) ||
(GC.getTechInfo((TechTypes)iI).getEra() < getStartEra()))
{
bValid = true;
}
}
if (!bValid)
{
for (iK = 0; iK < MAX_PLAYERS; iK++)
{
if (GET_PLAYER((PlayerTypes)iK).isAlive())
{
if (GET_PLAYER((PlayerTypes)iK).getTeam() == iJ)
{
if (GC.getCivilizationInfo(GET_PLAYER((PlayerTypes)iK ).getCivilizationType()).isCivilizationFreeTechs(i I))
{
bValid = true;
break;
}
}
}
}
}
GET_TEAM((TeamTypes)iJ).setHasTech(((TechTypes)iI) , bValid, NO_PLAYER, false, false);
}
}
}
for (iI = 0; iI < MAX_PLAYERS; iI++)
{
if (GET_PLAYER((PlayerTypes)iI).isAlive())
{
GET_PLAYER((PlayerTypes)iI).initFreeState();
}
}
}
I can email a compiled .dll with this change if anyone wants to see that it works ;) but even zipped its too large for the allowed attachment size :sad:
Misotu
Mar 22, 2007, 03:58 PM
This is brilliant. No problem with the, um, messy code as I can't write any kind of code, messy or otherwise :crazyeye:
Thanks so much :thumbsup: :hatsoff: