IsoRTS
IsoRTS copied to clipboard
Two potential issues
In "randomMapGenerator.cpp" the while loop on line 120 might never break if the return statement condition is never met I think?
bool foodFound = false;
while (!foodFound) {
int possibleFood = roll(0, static_cast<int>(listOfObjects.size()));
if (listOfObjects[possibleFood].getTypeOfResource() == 1) {
bool foodSourceOccupied = false;
for (const int& foodOwned : occupiedFoodSources)
{
if (foodOwned == possibleFood) {
foodSourceOccupied = true;
}
}
if (!foodSourceOccupied) {
return listOfObjects[possibleFood].getLocation();
}
}
}
In "main.cpp" line 111 I think this is meant to be a comparison and not assignment operator?
if (endProjectile = listOfProjectiles.size()) { ... }
adressed the first issue in: https://github.com/switchboy/IsoRTS/commit/69aeb535b1ee0289ea9f3e5c8315cdd6339202c9
The second one in: https://github.com/switchboy/IsoRTS/commit/d3d6f4b9f7543eb6316de9f34d40d7d2ed61d8fe