1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

accesible->accessible

This commit is contained in:
Frank Zago 2009-10-16 02:09:58 +00:00
parent 02ee620abc
commit 3cdefa2790
4 changed files with 12 additions and 12 deletions

View File

@ -1172,14 +1172,14 @@ CBattleInterface::CBattleInterface(CCreatureSet * army1, CCreatureSet * army2, C
int x = 14 + ((h/BFIELD_WIDTH)%2==0 ? 22 : 0) + 44*(h%BFIELD_WIDTH); int x = 14 + ((h/BFIELD_WIDTH)%2==0 ? 22 : 0) + 44*(h%BFIELD_WIDTH);
int y = 86 + 42 * (h/BFIELD_WIDTH); int y = 86 + 42 * (h/BFIELD_WIDTH);
bfield[h].pos = genRect(cellShade->h, cellShade->w, x + pos.x, y + pos.y); bfield[h].pos = genRect(cellShade->h, cellShade->w, x + pos.x, y + pos.y);
bfield[h].accesible = true; bfield[h].accessible = true;
bfield[h].myInterface = this; bfield[h].myInterface = this;
} }
//locking occupied positions on batlefield //locking occupied positions on batlefield
for(std::map<int, CStack>::iterator it = stacks.begin(); it!=stacks.end(); ++it) //stacks gained at top of this function for(std::map<int, CStack>::iterator it = stacks.begin(); it!=stacks.end(); ++it) //stacks gained at top of this function
{ {
if(it->second.position >= 0) //turrets have position < 0 if(it->second.position >= 0) //turrets have position < 0
bfield[it->second.position].accesible = false; bfield[it->second.position].accessible = false;
} }
//loading projectiles for units //loading projectiles for units
@ -3307,7 +3307,7 @@ void CBattleHex::hover(bool on)
} }
} }
CBattleHex::CBattleHex() : setAlterText(false), myNumber(-1), accesible(true), hovered(false), strictHovered(false), myInterface(NULL) CBattleHex::CBattleHex() : setAlterText(false), myNumber(-1), accessible(true), hovered(false), strictHovered(false), myInterface(NULL)
{ {
} }

View File

@ -243,7 +243,7 @@ private:
bool setAlterText; //if true, this hex has set alternative text in console and will clean it bool setAlterText; //if true, this hex has set alternative text in console and will clean it
public: public:
unsigned int myNumber; //number of hex in commonly used format unsigned int myNumber; //number of hex in commonly used format
bool accesible; //if true, this hex is accessible for units bool accessible; //if true, this hex is accessible for units
//CStack * ourStack; //CStack * ourStack;
bool hovered, strictHovered; //for determining if hex is hovered by mouse (this is different problem than hex's graphic hovering) bool hovered, strictHovered; //for determining if hex is hovered by mouse (this is different problem than hex's graphic hovering)
CBattleInterface * myInterface; //interface that owns me CBattleInterface * myInterface; //interface that owns me

View File

@ -1911,7 +1911,7 @@ bool CGameState::getPath(int3 src, int3 dest, const CGHeroInstance * hero, CPath
const TerrainTile *tinfo = &map->terrain[i][j][src.z]; const TerrainTile *tinfo = &map->terrain[i][j][src.z];
CPathNode &node = graph[i][j]; CPathNode &node = graph[i][j];
node.accesible = !tinfo->blocked; node.accessible = !tinfo->blocked;
node.dist = -1; node.dist = -1;
node.theNodeBefore = NULL; node.theNodeBefore = NULL;
node.visited = false; node.visited = false;
@ -1925,7 +1925,7 @@ bool CGameState::getPath(int3 src, int3 dest, const CGHeroInstance * hero, CPath
|| !FoW[i][j][src.z] //tile is covered by the FoW || !FoW[i][j][src.z] //tile is covered by the FoW
) )
{ {
node.accesible = false; node.accessible = false;
} }
} }
} }
@ -1939,7 +1939,7 @@ bool CGameState::getPath(int3 src, int3 dest, const CGHeroInstance * hero, CPath
//tile may be blocked by blockvis / normal vis obj but it still must be accessible //tile may be blocked by blockvis / normal vis obj but it still must be accessible
if(t->visitable) if(t->visitable)
{ {
d.accesible = true; //for allowing visiting objects d.accessible = true; //for allowing visiting objects
} }
if(blockLandSea && t->tertype == TerrainTile::water) //hero can walk only on land and dst lays on the water if(blockLandSea && t->tertype == TerrainTile::water) //hero can walk only on land and dst lays on the water
@ -1949,11 +1949,11 @@ bool CGameState::getPath(int3 src, int3 dest, const CGHeroInstance * hero, CPath
if(t->visitableObjects[i]->ID == 8 || t->visitableObjects[i]->ID == HEROI_TYPE) //it's a Boat if(t->visitableObjects[i]->ID == 8 || t->visitableObjects[i]->ID == HEROI_TYPE) //it's a Boat
break; break;
d.accesible = (i < t->visitableObjects.size()); //dest is accessible only if there is boat/hero d.accessible = (i < t->visitableObjects.size()); //dest is accessible only if there is boat/hero
} }
else if(!blockLandSea && t->tertype != TerrainTile::water) //hero is moving by water else if(!blockLandSea && t->tertype != TerrainTile::water) //hero is moving by water
{ {
d.accesible = (t->siodmyTajemniczyBajt & 64) && !t->blocked; //tile is accessible if it's coastal and not blocked d.accessible = (t->siodmyTajemniczyBajt & 64) && !t->blocked; //tile is accessible if it's coastal and not blocked
} }
} }
@ -1991,10 +1991,10 @@ bool CGameState::getPath(int3 src, int3 dest, const CGHeroInstance * hero, CPath
for(unsigned int i=0; i < neighbours.size(); i++) for(unsigned int i=0; i < neighbours.size(); i++)
{ {
CPathNode & dp = graph[neighbours[i].x][neighbours[i].y]; CPathNode & dp = graph[neighbours[i].x][neighbours[i].y];
if(dp.accesible) if(dp.accessible)
{ {
int cost = getMovementCost(hero,cp.coord,dp.coord,hero->movement - cp.dist); int cost = getMovementCost(hero,cp.coord,dp.coord,hero->movement - cp.dist);
if((dp.dist==-1 || (dp.dist > cp.dist + cost)) && dp.accesible && checkForVisitableDir(cp.coord, dp.coord) && checkForVisitableDir(dp.coord, cp.coord)) if((dp.dist==-1 || (dp.dist > cp.dist + cost)) && dp.accessible && checkForVisitableDir(cp.coord, dp.coord) && checkForVisitableDir(dp.coord, cp.coord))
{ {
dp.dist = cp.dist + cost; dp.dist = cp.dist + cost;
dp.theNodeBefore = &cp; dp.theNodeBefore = &cp;

View File

@ -254,7 +254,7 @@ struct UpgradeInfo
struct CPathNode struct CPathNode
{ {
bool accesible; //true if a hero can be on this node bool accessible; //true if a hero can be on this node
int dist; //distance from the first node of searching; -1 is infinity int dist; //distance from the first node of searching; -1 is infinity
CPathNode * theNodeBefore; CPathNode * theNodeBefore;
int3 coord; //coordiantes int3 coord; //coordiantes