Ekmek
on steam: ekmek_e
hmm apolyton is down, but in the chance that refugees migrate here....
I already posted my other code, I hope its done and looking to add this code to start the ball on adding resources:
HasResource is a function I found in citydata and unit.cpp and unitdata.cpp (the unit files reference m_city_data)
I figure if I put the above code into the CanBuildUnit(building and wonder)
it should compare the two to see if a unit can build. This is assuming that HasResource means what it says, and it looks like that is the same function to find if a city has a resource to trade.
I already posted my other code, I hope its done and looking to add this code to start the ball on adding resources:
Code:
if(irec->GetNumNeedsCityGood() > 0) {
sint32 s;
sint32 resource;
bool found = false;
for(s = 0; s < irec->GetNumNeedsCityGood(); s++) {
if(irec->GetNeedsCityGoodIndex(s) == HasResource(resource) {
found = true;
break;
}
}
if(!found)
return FALSE;
}
HasResource is a function I found in citydata and unit.cpp and unitdata.cpp (the unit files reference m_city_data)
I figure if I put the above code into the CanBuildUnit(building and wonder)
it should compare the two to see if a unit can build. This is assuming that HasResource means what it says, and it looks like that is the same function to find if a city has a resource to trade.
