[SDK mod] Borders over Ocean

Hi Roger Bacon. So if I change the boolean to false, it'll nullify the changes? (I'm actually opting to go back to no ocean borders for my mod, though I've never experienced them cuz I've always been patched)

To go back change

if (true)//pLoopPlot->isPotentialCityWorkForArea(area())) // Borders over Water -RogerBacon

to

if (pLoopPlot->isPotentialCityWorkForArea(area())) // Borders over Water -RogerBacon

In C++ the // is a comment. It means ignore everything that comes after it. By removing the // you re-enable the code.
 
thank you very much :)
 
It seems your SDK changes weren't compatible with BTS, although obviously they are using borders over water.

This is the BTS code, as I see it (though it says "void" cvcity::doplotculture)

Code:
void CvCity::doPlotCulture(bool bUpdate, PlayerTypes ePlayer, int iCultureRate)
{
	CvPlot* pLoopPlot;
	int iDX, iDY;
	int iCultureRange;
	CultureLevelTypes eCultureLevel = (CultureLevelTypes)0;

	CyCity* pyCity = new CyCity(this);
	CyArgsList argsList;
	argsList.add(gDLL->getPythonIFace()->makePythonObject(pyCity));	// pass in city class
	argsList.add(bUpdate);
	argsList.add(ePlayer);
	argsList.add(iCultureRate);
	long lResult=0;
	gDLL->getPythonIFace()->callFunction(PYGameModule, "doPlotCulture", argsList.makeFunctionArgs(), &lResult);
	delete pyCity;	// python fxn must not hold on to this pointer 
	if (lResult == 1)
	{
		return;
	}

	FAssert(NO_PLAYER != ePlayer);

	if (getOwnerINLINE() == ePlayer)
	{
		eCultureLevel = getCultureLevel();
	}
	else
	{
		for (int iI = (GC.getNumCultureLevelInfos() - 1); iI > 0; iI--)
		{
			if (getCultureTimes100(ePlayer) >= 100 * GC.getCultureLevelInfo((CultureLevelTypes)iI).getSpeedThreshold(GC.getGameINLINE().getGameSpeedType()))
			{
				eCultureLevel = (CultureLevelTypes)iI;
				break;
			}
		}
	}

	int iFreeCultureRate = GC.getDefineINT("CITY_FREE_CULTURE_GROWTH_FACTOR");
	if (getCultureTimes100(ePlayer) > 0)
	{
		if (eCultureLevel != NO_CULTURELEVEL)
		{
			for (iDX = -eCultureLevel; iDX <= eCultureLevel; iDX++)
			{
				for (iDY = -eCultureLevel; iDY <= eCultureLevel; iDY++)
				{
					iCultureRange = cultureDistance(iDX, iDY);

					if (iCultureRange <= eCultureLevel)
					{
						pLoopPlot = plotXY(getX_INLINE(), getY_INLINE(), iDX, iDY);

						if (pLoopPlot != NULL)
						{
							if (pLoopPlot->isPotentialCityWorkForArea(area()))
							{
								pLoopPlot->changeCulture(ePlayer, (((eCultureLevel - iCultureRange) * iFreeCultureRate) + iCultureRate + 1), (bUpdate || !(pLoopPlot->isOwned())));
							}
						}
					}
				}
			}
		}
	}
}

Do you have any idea how you could change it back from this?

If I find out how I'll let everyone know here


EDIT: what's really weird is that in warlords... it's already what you told me to change it to, and borders definitely go over ocean... weird... any ideas? EDIT: same goes for vanilla...

EDIT: also, why did someone ask if it's compatible with bts, if borders already extend over water? Am I confusing what this mod does?
 
I think that this changed with BTS: prior to BTS, borders didn't extend over the ocean without this modcomp.
 
I don't know how it is in Warlords or BTS but in the original the borders went out one or two squares into the water-- just enough to cover the areas that your city could work. My mod removed the condition that the square had to workable so the borders would go out over water just like over land.
From the code you posted above it looks like the game still requires the square to be a workable square.
 
Top Bottom