mirror of
https://github.com/glest/glest-source.git
synced 2025-09-02 12:32:34 +02:00
Removed max selection count
This commit is contained in:
@@ -63,7 +63,8 @@ namespace Glest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Display::setUpImage(int i, const Texture2D *image) {
|
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;
|
upImages[i] = image;
|
||||||
calculateUpDimensions(i);
|
calculateUpDimensions(i);
|
||||||
}
|
}
|
||||||
|
@@ -54,10 +54,6 @@ namespace Glest {
|
|||||||
|
|
||||||
bool Selection::select(Unit *unit, bool addToSelection) {
|
bool Selection::select(Unit *unit, bool addToSelection) {
|
||||||
bool result = false;
|
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
|
// Fix Bug reported on sourceforge.net: Glest::Game::Selection::select crash with NULL pointer - ID: 3608835
|
||||||
if (unit != NULL) {
|
if (unit != NULL) {
|
||||||
//check if already selected
|
//check if already selected
|
||||||
@@ -261,8 +257,6 @@ namespace Glest {
|
|||||||
throw megaglest_runtime_error("Invalid value for groupIndex = " + intToStr(groupIndex));
|
throw megaglest_runtime_error("Invalid value for groupIndex = " + intToStr(groupIndex));
|
||||||
}
|
}
|
||||||
bool alreadyExists = false;
|
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) {
|
for (int i = 0; i < (int) groups[groupIndex].size(); ++i) {
|
||||||
if (groups[groupIndex][i] == unit) {
|
if (groups[groupIndex][i] == unit) {
|
||||||
alreadyExists = true;
|
alreadyExists = true;
|
||||||
@@ -302,7 +296,7 @@ namespace Glest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unit != NULL && !groupIsFull) {
|
if (unit != NULL) {
|
||||||
groups[groupIndex].push_back(unit);
|
groups[groupIndex].push_back(unit);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -49,7 +49,6 @@ namespace Glest {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static const int maxGroups = 10;
|
static const int maxGroups = 10;
|
||||||
static const int maxUnits = 36;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int factionIndex;
|
int factionIndex;
|
||||||
|
Reference in New Issue
Block a user