Merge branch 'develop' of github.com:MegaGlest/megaglest-source into develop

This commit is contained in:
titiger 2014-12-22 03:05:33 +01:00
commit 48db19c34b
3 changed files with 17 additions and 3 deletions

View File

@ -1406,7 +1406,7 @@ FowAlphaCellsLookupItem Unit::getFogOfWarRadius(bool useCache) const {
}
//iterate through all cells
int sightRange= this->getType()->getSight();
int sightRange= this->getType()->getTotalSight(this->getTotalUpgrade());
int radius = sightRange + World::indirectSightRange;
PosCircularIterator pci(map, this->getPosNotThreadSafe(), radius);
FowAlphaCellsLookupItem result;
@ -4365,7 +4365,7 @@ uint32 Unit::getFrameCount() const {
void Unit::exploreCells() {
if(this->isOperative() == true) {
const Vec2i &newPos = this->getCenteredPos();
int sightRange = this->getType()->getSight();
int sightRange = this->getType()->getTotalSight(this->getTotalUpgrade());
int teamIndex = this->getTeam();
if(game == NULL) {

View File

@ -170,11 +170,25 @@ bool SurfaceCell::decAmount(int value) {
return object->getResource()->decAmount(value);
}
void SurfaceCell::setExplored(int teamIndex, bool explored) {
if(teamIndex < 0 || teamIndex >= GameConstants::maxPlayers + GameConstants::specialFactions) {
char szBuf[8096]="";
snprintf(szBuf,8096,"Invalid value for teamIndex [%d]",teamIndex);
printf("%s\n",szBuf);
throw megaglest_runtime_error(szBuf);
}
this->explored[teamIndex]= explored;
//printf("Setting explored to %d for teamIndex %d\n",explored,teamIndex);
}
void SurfaceCell::setVisible(int teamIndex, bool visible) {
if(teamIndex < 0 || teamIndex >= GameConstants::maxPlayers + GameConstants::specialFactions) {
char szBuf[8096]="";
snprintf(szBuf,8096,"Invalid value for teamIndex [%d]",teamIndex);
printf("%s\n",szBuf);
throw megaglest_runtime_error(szBuf);
}
this->visible[teamIndex]= visible;
}

View File

@ -2760,7 +2760,7 @@ bool UnitUpdater::attackerOnSight(Unit *unit, Unit **rangedPtr, bool evalMode){
}
bool UnitUpdater::attackableOnSight(Unit *unit, Unit **rangedPtr, const AttackSkillType *ast, bool evalMode) {
int range= unit->getType()->getSight();
int range = unit->getType()->getTotalSight(unit->getTotalUpgrade());
return unitOnRange(unit, range, rangedPtr, ast, evalMode);
}