Kailric
Jack of All Trades
Yeah, I saw that XML entry, so I figured other something was broken or removed from the SDK, or you had added something in the SDk that just over rode it.
Is this controlled by just one file in the SDK, or is it spread out over several files? I know how to compile SDk and have made some changes in the past, as well as modcomp merging, but always civ4, and I still don't 'really' understand what I am doing, but sometimes 'poop is magical', or a Wizard uses some of theirs!![]()
The Code is below. And for example if you removed the parts in blue it should allow the Silk Road to be a land or sea route.
Spoiler :
bool CvUnit::canCrossOcean(const CvPlot* pPlot, UnitTravelStates eNewState, TradeRouteTypes eTradeRouteType, bool bAIForce) const
{
if (getTransportUnit() != NULL)
{
return false;
}
if (m_pUnitInfo->isPreventTraveling())
{
return false;
}
if (getUnitTravelState() == NO_UNIT_TRAVEL_STATE && !canMove())
{
return false;
}
switch (getUnitTravelState())
{
case NO_UNIT_TRAVEL_STATE:
if (eNewState != UNIT_TRAVEL_STATE_TO_EUROPE)
{
if (eNewState != UNIT_TRAVEL_STATE_TO_SPICE_ROUTE)
{
if (eNewState != UNIT_TRAVEL_STATE_TO_SILK_ROAD)
{
if (eNewState != UNIT_TRAVEL_STATE_TO_TRADE_FAIR)
{
return false;
}
}
}
}
if (eNewState == UNIT_TRAVEL_STATE_TO_SPICE_ROUTE)
{
if (getDomainType() != DOMAIN_SEA)
{
return false;
}
if (!GET_PLAYER(getOwnerINLINE()).getHasTradeRouteType(TRADE_ROUTE_SPICE_ROUTE))
{
return false;
}
if (pPlot->isEurope())
{
//EuropeTypes eEurope = (EuropeTypes)pPlot->getEurope();
if (GC.getEuropeInfo(pPlot->getEurope()).getTradeScreensValid(TRADE_SCREEN_SPICE_ROUTE))
{
return true;
}
}
return false;
}
else if (eNewState == UNIT_TRAVEL_STATE_TO_SILK_ROAD)
{
if (getDomainType() != DOMAIN_LAND)
{
return false;
}
if (!GET_PLAYER(getOwnerINLINE()).getHasTradeRouteType(TRADE_ROUTE_SILK_ROAD))
{
return false;
}
//EuropeTypes eEurope = (EuropeTypes)pPlot->getEurope();
if (pPlot->isEurope())
{
if (GC.getEuropeInfo(pPlot->getEurope()).getTradeScreensValid(TRADE_SCREEN_SILK_ROAD))
{
return true;
}
}
if (!isHuman() && bAIForce)
{
CvCity* pCity = plot()->getPlotCity();
if (pCity != NULL)
{
// if (pCity->isNative())
// {
// return false;
// }
if (pCity->getOwner() != getOwner())
{
return true;
}
}
}
return false;
}
else if (eNewState == UNIT_TRAVEL_STATE_TO_TRADE_FAIR)
{
if (getDomainType() != DOMAIN_LAND)
{
return false;
}
if (!GET_PLAYER(getOwnerINLINE()).getHasTradeRouteType(TRADE_ROUTE_FAIR))
{
return false;
}
}
if (!GET_PLAYER(getOwnerINLINE()).canTradeWithEurope())
{
return false;
}
break;
case UNIT_TRAVEL_STATE_IN_EUROPE:
if (eNewState != UNIT_TRAVEL_STATE_FROM_EUROPE)
{
return false;
}
break;
case UNIT_TRAVEL_STATE_IN_SPICE_ROUTE:
if (eNewState == UNIT_TRAVEL_STATE_FROM_SPICE_ROUTE)
{
return true;
}
break;
case UNIT_TRAVEL_STATE_IN_SILK_ROAD:
if (eNewState == UNIT_TRAVEL_STATE_FROM_SILK_ROAD)
{
return true;
}
break;
case UNIT_TRAVEL_STATE_IN_TRADE_FAIR:
if (eNewState == UNIT_TRAVEL_STATE_FROM_TRADE_FAIR)
{
return true;
}
break;
default:
FAssertMsg(false, "Invalid trip");
return false;
break;
}
if(isHuman() && !GC.getCivilizationInfo(getCivilizationType()).isWaterStart() && (eTradeRouteType == TRADE_ROUTE_FAIR))
{
if (getDomainType() != DOMAIN_LAND)
{
return false;
}
if (cargoSpace() <= 0)
{
return false;
}
if (!plot()->isCity() && getUnitTravelState() == NO_UNIT_TRAVEL_STATE)
{
return false;
}
CvCity* pCity = plot()->getPlotCity();
if (pCity != NULL)
{
if (pCity->isNative())
{
return false;
}
if (pCity->getOwner() != getOwner())
{
return false;
}
else
{
if (GC.getXMLval(XML_CHEAT_TRAVEL_ALL))
{
return true;
}
// if (eTradeRouteType == TRADE_ROUTE_FAIR)
// {
// BuildingClassTypes eIndex = (BuildingClassTypes)GC.getDefineINT("BUILDINGCLASS_TRAVEL_TO_FAIR");
// BuildingTypes eBuilding = (BuildingTypes) GC.getCivilizationInfo(GET_PLAYER(getOwnerINLINE()).getCivilizationType()).getCivilizationBuildings(eIndex);
// if(eBuilding == NO_BUILDING)
// {
// return false;
// }
//
// if (pCity->isHasConceptualBuilding(eBuilding))
// {
// return true;
// }
// }
}
}
return true;
}
///TKe
FAssert(pPlot != NULL);
if (!pPlot->isEurope())
{
return false;
}
return true;
}