• 📚 A new project from the admin: Check out PictureBooks.io, an AI storyteller that lets you create personalized picture books for kids in seconds. Give it a try and let me know what you think!

<TerrainDoubleMoves> not working

avain

(key)
Joined
Jul 29, 2006
Messages
2,770
Location
Budapest, EU
Hi,

Does anyone have any idea why?
BTW, to complicate things, it does work under certain circumstances, e.g. if I make a desert terrain double move, the unit WILL move double on Desert/Hill, but not on Desert...
 
Do you also have bHillDoubleMove set to 1?

I didn't have time to test this idea, so it's purely a guess - since hills are a terrain type could bHillDoubleMove override TerrainDoubleMoves?
 
Do you also have bHillDoubleMove set to 1?

I didn't have time to test this idea, so it's purely a guess - since hills are a terrain type could bHillDoubleMove override TerrainDoubleMoves?

Nope.
 
I think I've found the problem in CvPlot.cpp:

PHP:
	if (bHasTerrainCost)
	{
		if (((getFeatureType() == NO_FEATURE) ? pUnit->isTerrainDoubleMove(getTerrainType()) : pUnit->isFeatureDoubleMove(getFeatureType())) ||
			(isHills() && pUnit->isHillsDoubleMove()))
		{
			iRegularCost /= 2;
		}
	}


If a plot does not have additional TerrainCost, the unit will not be able to move more than usual.

Jungle, Forest and Hills have additional TerrainCost - but Desert, Ice, etc not.

Maybe just remove the "if (bHasTerrainCost)" part?
 
This seems to work. I have not had any bug oder glitch yet.
 
Back
Top Bottom