- limit current resource amounts to max storage allowed at game start
This commit is contained in:
parent
a77aa5e4be
commit
cb113514e1
|
@ -737,14 +737,11 @@ void Faction::removeStore(const UnitType *unitType){
|
||||||
limitResourcesToStore();
|
limitResourcesToStore();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Faction::limitResourcesToStore()
|
void Faction::limitResourcesToStore() {
|
||||||
{
|
for(int i=0; i<resources.size(); ++i) {
|
||||||
for(int i=0; i<resources.size(); ++i)
|
|
||||||
{
|
|
||||||
Resource *r= &resources[i];
|
Resource *r= &resources[i];
|
||||||
Resource *s= &store[i];
|
Resource *s= &store[i];
|
||||||
if(r->getType()->getClass() != rcStatic && r->getAmount()>s->getAmount())
|
if(r->getType()->getClass() != rcStatic && r->getAmount()>s->getAmount()) {
|
||||||
{
|
|
||||||
r->setAmount(s->getAmount());
|
r->setAmount(s->getAmount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,11 +195,11 @@ public:
|
||||||
int getFrameCount();
|
int getFrameCount();
|
||||||
void signalWorkerThread(int frameIndex);
|
void signalWorkerThread(int frameIndex);
|
||||||
bool isWorkerThreadSignalCompleted(int frameIndex);
|
bool isWorkerThreadSignalCompleted(int frameIndex);
|
||||||
|
void limitResourcesToStore();
|
||||||
|
|
||||||
std::string toString() const;
|
std::string toString() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void limitResourcesToStore();
|
|
||||||
void resetResourceAmount(const ResourceType *rt);
|
void resetResourceAmount(const ResourceType *rt);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1272,6 +1272,9 @@ void World::initUnits() {
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] unit created for unit [%s]\n",__FILE__,__FUNCTION__,__LINE__,unit->toString().c_str());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] unit created for unit [%s]\n",__FILE__,__FUNCTION__,__LINE__,unit->toString().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure Starting Resource Amount are adjusted to max store levels
|
||||||
|
f->limitResourcesToStore();
|
||||||
}
|
}
|
||||||
map.computeNormals();
|
map.computeNormals();
|
||||||
map.computeInterpolatedHeights();
|
map.computeInterpolatedHeights();
|
||||||
|
|
Loading…
Reference in New Issue