flood delete will delete walls even if wall delete tool isn't selected

This commit is contained in:
jacob1 2013-07-18 18:30:24 -04:00
parent 6a4cc7e1f7
commit 40285e107a
2 changed files with 19 additions and 15 deletions

View File

@ -1471,8 +1471,10 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
break;
case SDLK_INSERT:
c->SetReplaceModeFlags(c->GetReplaceModeFlags()^REPLACE_MODE);
break;
case SDLK_DELETE:
c->SetReplaceModeFlags(c->GetReplaceModeFlags()^SPECIFIC_DELETE);
break;
}
if (shift && showDebug && key == '1')

View File

@ -1434,13 +1434,15 @@ int Simulation::FloodParts(int x, int y, int fullc, int cm, int flags)
//if initial flood point is out of bounds, do nothing
if (c != 0 && (x < CELL || x >= XRES-CELL || y < CELL || y >= YRES-CELL))
return 1;
else if (x < 0 || x >= XRES || y < 0 || y >= YRES)
return 1;
if (c==0)
{
cm = pmap[y][x]&0xFF;
if (!cm)
cm = photons[y][x]&0xFF;
if (!cm)
return 0;
if (!cm && bmap[y/CELL][x/CELL])
FloodWalls(x, y, WL_ERASE, -1, flags);
}
else
cm = 0;