- small fix for fog of war cache

This commit is contained in:
Mark Vejvoda 2013-01-04 20:35:38 +00:00
parent b96eba3829
commit b14167d209
2 changed files with 3 additions and 1 deletions

View File

@ -1131,8 +1131,9 @@ FowAlphaCellsLookupItem Unit::getFogOfWarRadius(bool useCache) const {
void Unit::calculateFogOfWarRadius() {
if(game->getWorld()->getFogOfWar() == true) {
if(Config::getInstance().getBool("EnableFowCache","true") == true && this->pos != this->lastPos) {
if(Config::getInstance().getBool("EnableFowCache","true") == true && this->pos != this->cachedFowPos) {
cachedFow = getFogOfWarRadius(false);
this->cachedFowPos = this->pos;
}
}
}

View File

@ -457,6 +457,7 @@ private:
int pathFindRefreshCellCount;
FowAlphaCellsLookupItem cachedFow;
Vec2i cachedFowPos;
public:
Unit(int id, UnitPathInterface *path, const Vec2i &pos, const UnitType *type, Faction *faction, Map *map, CardinalDir placeFacing);