diff --git a/source/glest_game/type_instances/faction.cpp b/source/glest_game/type_instances/faction.cpp index 500e4138..9e101f0d 100644 --- a/source/glest_game/type_instances/faction.cpp +++ b/source/glest_game/type_instances/faction.cpp @@ -737,14 +737,11 @@ void Faction::removeStore(const UnitType *unitType){ limitResourcesToStore(); } -void Faction::limitResourcesToStore() -{ - for(int i=0; igetType()->getClass() != rcStatic && r->getAmount()>s->getAmount()) - { + if(r->getType()->getClass() != rcStatic && r->getAmount()>s->getAmount()) { r->setAmount(s->getAmount()); } } diff --git a/source/glest_game/type_instances/faction.h b/source/glest_game/type_instances/faction.h index d1d60fd1..0d6122a0 100644 --- a/source/glest_game/type_instances/faction.h +++ b/source/glest_game/type_instances/faction.h @@ -195,11 +195,11 @@ public: int getFrameCount(); void signalWorkerThread(int frameIndex); bool isWorkerThreadSignalCompleted(int frameIndex); + void limitResourcesToStore(); std::string toString() const; private: - void limitResourcesToStore(); void resetResourceAmount(const ResourceType *rt); }; diff --git a/source/glest_game/world/world.cpp b/source/glest_game/world/world.cpp index 81709c4b..f2f99d2c 100644 --- a/source/glest_game/world/world.cpp +++ b/source/glest_game/world/world.cpp @@ -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()); } } + + // Ensure Starting Resource Amount are adjusted to max store levels + f->limitResourcesToStore(); } map.computeNormals(); map.computeInterpolatedHeights();