- small fix for fog of war cache
This commit is contained in:
parent
b96eba3829
commit
b14167d209
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue