Removed max selection count

This commit is contained in:
mathusummut
2018-06-10 11:41:20 +02:00
parent ab8184a6cd
commit fbe63bbacf
3 changed files with 3 additions and 9 deletions

View File

@@ -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);
}

View File

@@ -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 {

View File

@@ -49,7 +49,6 @@ namespace Glest {
public:
static const int maxGroups = 10;
static const int maxUnits = 36;
private:
int factionIndex;