Skip to content

Commit 9c54478

Browse files
committed
Remove the unused code of EXPAND_ONE_CELL
1 parent 463cd25 commit 9c54478

File tree

2 files changed

+0
-130
lines changed

2 files changed

+0
-130
lines changed

Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -3838,71 +3838,6 @@ void Pathfinder::internal_classifyObjectFootprint( Object *obj, Bool insert )
38383838
cellBounds.hi.y = m_extent.hi.y;
38393839
}
38403840

3841-
3842-
3843-
// Expand building bounds 1 cell.
3844-
#define no_EXPAND_ONE_CELL
3845-
#ifdef EXPAND_ONE_CELL
3846-
for( j=cellBounds.lo.y; j<=cellBounds.hi.y; j++ )
3847-
{
3848-
for( i=cellBounds.lo.x; i<=cellBounds.hi.x; i++ )
3849-
{
3850-
if (!insert) {
3851-
if (m_map[i][j].getType() == PathfindCell::CELL_IMPASSABLE) {
3852-
m_map[i][j].setType(PathfindCell::CELL_CLEAR);
3853-
}
3854-
m_map[i][j].setPinched(false);
3855-
}
3856-
if (!insert) {
3857-
if (m_map[i][j].isObstaclePresent(obj->getID())) {
3858-
m_map[i][j].removeObstacle( obj );
3859-
}
3860-
continue;
3861-
}
3862-
if (m_map[i][j].getType() == PathfindCell::CELL_CLEAR) {
3863-
Bool obstacleAdjacent = false;
3864-
Int k, l;
3865-
for (k=i-1; k<i+2; k++) {
3866-
if (k<m_extent.lo.x || k> m_extent.hi.x) continue;
3867-
for (l=j-1; l<j+2; l++) {
3868-
if (l<m_extent.lo.y || l> m_extent.hi.y) continue;
3869-
if ((k==i) && (l==j)) continue;
3870-
if ((k!=i) && (l!=j)) continue;
3871-
if (m_map[k][l].getType()!=PathfindCell::CELL_CLEAR) {
3872-
obstacleAdjacent = true;
3873-
break;
3874-
}
3875-
3876-
}
3877-
}
3878-
if (obstacleAdjacent) {
3879-
m_map[i][j].setPinched(true);
3880-
}
3881-
// If the total open cells are < 2
3882-
}
3883-
}
3884-
}
3885-
3886-
if (insert) {
3887-
for( j=cellBounds.lo.y; j<=cellBounds.hi.y; j++ )
3888-
{
3889-
for( i=cellBounds.lo.x; i<=cellBounds.hi.x; i++ )
3890-
{
3891-
if (m_map[i][j].getPinched() && m_map[i][j].getType() == PathfindCell::CELL_CLEAR) {
3892-
ICoord2D pos;
3893-
pos.x = i;
3894-
pos.y = j;
3895-
m_map[i][j].setTypeAsObstacle( obj, false, pos );
3896-
//m_map[i][j].setType(PathfindCell::CELL_CLIFF);
3897-
m_map[i][j].setPinched(false);
3898-
}
3899-
}
3900-
}
3901-
}
3902-
#endif
3903-
3904-
3905-
39063841
if (!insert) {
39073842
for( j=cellBounds.lo.y; j<=cellBounds.hi.y; j++ )
39083843
{

GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -4330,71 +4330,6 @@ void Pathfinder::internal_classifyObjectFootprint( Object *obj, Bool insert )
43304330
cellBounds.hi.y = m_extent.hi.y;
43314331
}
43324332

4333-
4334-
4335-
// Expand building bounds 1 cell.
4336-
#define no_EXPAND_ONE_CELL
4337-
#ifdef EXPAND_ONE_CELL
4338-
for( j=cellBounds.lo.y; j<=cellBounds.hi.y; j++ )
4339-
{
4340-
for( i=cellBounds.lo.x; i<=cellBounds.hi.x; i++ )
4341-
{
4342-
if (!insert) {
4343-
if (m_map[i][j].getType() == PathfindCell::CELL_IMPASSABLE) {
4344-
m_map[i][j].setType(PathfindCell::CELL_CLEAR);
4345-
}
4346-
m_map[i][j].setPinched(false);
4347-
}
4348-
if (!insert) {
4349-
if (m_map[i][j].isObstaclePresent(obj->getID())) {
4350-
m_map[i][j].removeObstacle( obj );
4351-
}
4352-
continue;
4353-
}
4354-
if (m_map[i][j].getType() == PathfindCell::CELL_CLEAR) {
4355-
Bool obstacleAdjacent = false;
4356-
Int k, l;
4357-
for (k=i-1; k<i+2; k++) {
4358-
if (k<m_extent.lo.x || k> m_extent.hi.x) continue;
4359-
for (l=j-1; l<j+2; l++) {
4360-
if (l<m_extent.lo.y || l> m_extent.hi.y) continue;
4361-
if ((k==i) && (l==j)) continue;
4362-
if ((k!=i) && (l!=j)) continue;
4363-
if (m_map[k][l].getType()!=PathfindCell::CELL_CLEAR) {
4364-
obstacleAdjacent = true;
4365-
break;
4366-
}
4367-
4368-
}
4369-
}
4370-
if (obstacleAdjacent) {
4371-
m_map[i][j].setPinched(true);
4372-
}
4373-
// If the total open cells are < 2
4374-
}
4375-
}
4376-
}
4377-
4378-
if (insert) {
4379-
for( j=cellBounds.lo.y; j<=cellBounds.hi.y; j++ )
4380-
{
4381-
for( i=cellBounds.lo.x; i<=cellBounds.hi.x; i++ )
4382-
{
4383-
if (m_map[i][j].getPinched() && m_map[i][j].getType() == PathfindCell::CELL_CLEAR) {
4384-
ICoord2D pos;
4385-
pos.x = i;
4386-
pos.y = j;
4387-
m_map[i][j].setTypeAsObstacle( obj, false, pos );
4388-
//m_map[i][j].setType(PathfindCell::CELL_CLIFF);
4389-
m_map[i][j].setPinched(false);
4390-
}
4391-
}
4392-
}
4393-
}
4394-
#endif
4395-
4396-
4397-
43984333
if (!insert) {
43994334
for( j=cellBounds.lo.y; j<=cellBounds.hi.y; j++ )
44004335
{

0 commit comments

Comments
 (0)