1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-29 00:41:38 +02:00

Trading Post handling.

This commit is contained in:
Michał W. Urbańczyk
2010-05-18 07:01:54 +00:00
parent 71b73bad53
commit 1002bd2b4f
22 changed files with 372 additions and 102 deletions

View File

@ -1347,14 +1347,6 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed )
(*i).second.resources[x] = startres[x];
}
tis.open(DATA_DIR "/config/resources.txt");
tis >> k;
int pom;
for(int i=0;i<k;i++)
{
tis >> pom;
resVals.push_back(pom);
}
/*************************HEROES************************************************/
std::set<int> hids;
@ -1735,18 +1727,6 @@ UpgradeInfo CGameState::getUpgradeInfo(const CArmedInstance *obj, int stackPos)
return ret;
}
float CGameState::getMarketEfficiency( int player, int mode/*=0*/ )
{
boost::shared_lock<boost::shared_mutex> lock(*mx);
if(mode) return -1; //todo - support other modes
int mcount = 0;
for(unsigned int i=0;i<getPlayer(player)->towns.size();i++)
if(vstd::contains(getPlayer(player)->towns[i]->builtBuildings,14))
mcount++;
float ret = std::min(((float)mcount+1.0f)/20.0f,0.5f);
return ret;
}
void CGameState::loadTownDInfos()
{
for(int i=0;i<F_NUMBER;i++)