Merge branch 'develop' of github.com:MegaGlest/megaglest-source into develop
This commit is contained in:
commit
48db19c34b
|
@ -1406,7 +1406,7 @@ FowAlphaCellsLookupItem Unit::getFogOfWarRadius(bool useCache) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
//iterate through all cells
|
//iterate through all cells
|
||||||
int sightRange= this->getType()->getSight();
|
int sightRange= this->getType()->getTotalSight(this->getTotalUpgrade());
|
||||||
int radius = sightRange + World::indirectSightRange;
|
int radius = sightRange + World::indirectSightRange;
|
||||||
PosCircularIterator pci(map, this->getPosNotThreadSafe(), radius);
|
PosCircularIterator pci(map, this->getPosNotThreadSafe(), radius);
|
||||||
FowAlphaCellsLookupItem result;
|
FowAlphaCellsLookupItem result;
|
||||||
|
@ -4365,7 +4365,7 @@ uint32 Unit::getFrameCount() const {
|
||||||
void Unit::exploreCells() {
|
void Unit::exploreCells() {
|
||||||
if(this->isOperative() == true) {
|
if(this->isOperative() == true) {
|
||||||
const Vec2i &newPos = this->getCenteredPos();
|
const Vec2i &newPos = this->getCenteredPos();
|
||||||
int sightRange = this->getType()->getSight();
|
int sightRange = this->getType()->getTotalSight(this->getTotalUpgrade());
|
||||||
int teamIndex = this->getTeam();
|
int teamIndex = this->getTeam();
|
||||||
|
|
||||||
if(game == NULL) {
|
if(game == NULL) {
|
||||||
|
|
|
@ -170,11 +170,25 @@ bool SurfaceCell::decAmount(int value) {
|
||||||
return object->getResource()->decAmount(value);
|
return object->getResource()->decAmount(value);
|
||||||
}
|
}
|
||||||
void SurfaceCell::setExplored(int teamIndex, bool explored) {
|
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;
|
this->explored[teamIndex]= explored;
|
||||||
//printf("Setting explored to %d for teamIndex %d\n",explored,teamIndex);
|
//printf("Setting explored to %d for teamIndex %d\n",explored,teamIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfaceCell::setVisible(int teamIndex, bool visible) {
|
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;
|
this->visible[teamIndex]= visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
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);
|
return unitOnRange(unit, range, rangedPtr, ast, evalMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue