diff --git a/source/glest_game/gui/display.cpp b/source/glest_game/gui/display.cpp index 0884534a0..96c2a7a08 100644 --- a/source/glest_game/gui/display.cpp +++ b/source/glest_game/gui/display.cpp @@ -63,7 +63,8 @@ namespace Glest { } void Display::setUpImage(int i, const Texture2D *image) { - if (i >= upCellCount) throw megaglest_runtime_error("i>=upCellCount in Display::setUpImage"); + if (i >= upCellCount) + return; upImages[i] = image; calculateUpDimensions(i); } diff --git a/source/glest_game/gui/selection.cpp b/source/glest_game/gui/selection.cpp index f0a2797fe..7b7fb1e39 100644 --- a/source/glest_game/gui/selection.cpp +++ b/source/glest_game/gui/selection.cpp @@ -54,10 +54,6 @@ namespace Glest { bool Selection::select(Unit *unit, bool addToSelection) { bool result = false; - if ((int) selectedUnits.size() >= Config::getInstance().getInt("MaxUnitSelectCount", intToStr(maxUnits).c_str())) { - return result; - } - // Fix Bug reported on sourceforge.net: Glest::Game::Selection::select crash with NULL pointer - ID: 3608835 if (unit != NULL) { //check if already selected @@ -261,8 +257,6 @@ namespace Glest { throw megaglest_runtime_error("Invalid value for groupIndex = " + intToStr(groupIndex)); } bool alreadyExists = false; - bool groupIsFull = (int) groups[groupIndex].size() >= Config::getInstance().getInt("MaxUnitSelectCount", intToStr(maxUnits).c_str()); - for (int i = 0; i < (int) groups[groupIndex].size(); ++i) { if (groups[groupIndex][i] == unit) { alreadyExists = true; @@ -302,7 +296,7 @@ namespace Glest { } } - if (unit != NULL && !groupIsFull) { + if (unit != NULL) { groups[groupIndex].push_back(unit); return true; } else { diff --git a/source/glest_game/gui/selection.h b/source/glest_game/gui/selection.h index 9e83b40fd..e091fdf3e 100644 --- a/source/glest_game/gui/selection.h +++ b/source/glest_game/gui/selection.h @@ -49,7 +49,6 @@ namespace Glest { public: static const int maxGroups = 10; - static const int maxUnits = 36; private: int factionIndex;