mirror of
https://github.com/glest/glest-source.git
synced 2025-08-27 01:44:23 +02:00
- disabled a cache (cacheUnitCommandClassList) as we suspect this may cause crashes and is unstable
This commit is contained in:
@@ -979,6 +979,7 @@ Unit * Faction::findClosestUnitWithSkillClass( const Vec2i &pos,const CommandCla
|
|||||||
const UnitType *unitType) {
|
const UnitType *unitType) {
|
||||||
Unit *result = NULL;
|
Unit *result = NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
std::map<CommandClass,std::map<int,int> >::iterator iterFind = cacheUnitCommandClassList.find(cmdClass);
|
std::map<CommandClass,std::map<int,int> >::iterator iterFind = cacheUnitCommandClassList.find(cmdClass);
|
||||||
if(iterFind != cacheUnitCommandClassList.end()) {
|
if(iterFind != cacheUnitCommandClassList.end()) {
|
||||||
for(std::map<int,int>::iterator iter = iterFind->second.begin();
|
for(std::map<int,int>::iterator iter = iterFind->second.begin();
|
||||||
@@ -1008,6 +1009,7 @@ Unit * Faction::findClosestUnitWithSkillClass( const Vec2i &pos,const CommandCla
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if(result == NULL) {
|
if(result == NULL) {
|
||||||
for(int i = 0; i < getUnitCount(); ++i) {
|
for(int i = 0; i < getUnitCount(); ++i) {
|
||||||
@@ -1040,7 +1042,7 @@ Unit * Faction::findClosestUnitWithSkillClass( const Vec2i &pos,const CommandCla
|
|||||||
|
|
||||||
|
|
||||||
if(isUnitPossibleCandidate == true) {
|
if(isUnitPossibleCandidate == true) {
|
||||||
cacheUnitCommandClassList[cmdClass][curUnit->getId()] = curUnit->getId();
|
//cacheUnitCommandClassList[cmdClass][curUnit->getId()] = curUnit->getId();
|
||||||
|
|
||||||
if(result == NULL || curUnit->getPos().dist(pos) < result->getPos().dist(pos)) {
|
if(result == NULL || curUnit->getPos().dist(pos) < result->getPos().dist(pos)) {
|
||||||
result = curUnit;
|
result = curUnit;
|
||||||
|
Reference in New Issue
Block a user