Some more thoughts:
The option is pretty much the opposite of GAMEOPTION_ANIMALS_STAY_OUT.
One of them has to disable the other if both are used in a game. This should be explained in the tooltip for the one that disables the other; or for both.
Some animals should still be able to spawn within cities with GAMEOPTION_DANGEROUS_WILDLIFE active.
The option is pretty much the opposite of GAMEOPTION_ANIMALS_STAY_OUT.
One of them has to disable the other if both are used in a game. This should be explained in the tooltip for the one that disables the other; or for both.
Some animals should still be able to spawn within cities with GAMEOPTION_DANGEROUS_WILDLIFE active.
Spoiler Possible part of dll implementation :
Code:
bool CvUnit::canAnimalIgnoresBorders() const
{
if GC.getGameINLINE().isOption(GAMEOPTION_DANGEROUS_WILDLIFE)
{
return true;
}
if (!GC.getGameINLINE().isOption(GAMEOPTION_ANIMALS_STAY_OUT) && mayAnimalIgnoresBorders())
{
return true;
}
return false;
}
bool CvUnit::canAnimalIgnoresImprovements() const
{
if GC.getGameINLINE().isOption(GAMEOPTION_DANGEROUS_WILDLIFE)
{
return true;
}
if !GC.getGameINLINE().isOption(GAMEOPTION_ANIMALS_STAY_OUT)
{
int iAnswer = m_pUnitInfo->canAnimalIgnoresBorders();
iAnswer += getAnimalIgnoresBordersCount();
return (iAnswer > 1);
}
return false;
}
bool CvUnit::canAnimalIgnoresCities() const
{
if (!GC.getGameINLINE().isOption(GAMEOPTION_ANIMALS_STAY_OUT))
{
int iAnswer = m_pUnitInfo->canAnimalIgnoresBorders();
iAnswer += getAnimalIgnoresBordersCount();
return (iAnswer > 2);
}
return false;
bool CvSpawnInfo::getNeutralOnly()
{
if (GC.getUnitInfo(getUnitType()).isWildAnimal() && GC.getGameINLINE().isOption(GAMEOPTION_DANGEROUS_WILDLIFE))
{
return false;
}
return m_bNeutralOnly;
}
}
Last edited:
However my suggestion was not about modules per se, but just about how you maintain the XML files. In the same way as we have separated the regular, special and wonder buildings you could have separate files for the different spawn options. In this case though you would be able to use comparison software between the files to keep the bits in sync easier than having them all in one file.