mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-31 19:51:45 +02:00
flood delete will delete walls even if wall delete tool isn't selected
This commit is contained in:
@@ -1471,8 +1471,10 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
|
|||||||
break;
|
break;
|
||||||
case SDLK_INSERT:
|
case SDLK_INSERT:
|
||||||
c->SetReplaceModeFlags(c->GetReplaceModeFlags()^REPLACE_MODE);
|
c->SetReplaceModeFlags(c->GetReplaceModeFlags()^REPLACE_MODE);
|
||||||
|
break;
|
||||||
case SDLK_DELETE:
|
case SDLK_DELETE:
|
||||||
c->SetReplaceModeFlags(c->GetReplaceModeFlags()^SPECIFIC_DELETE);
|
c->SetReplaceModeFlags(c->GetReplaceModeFlags()^SPECIFIC_DELETE);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shift && showDebug && key == '1')
|
if (shift && showDebug && key == '1')
|
||||||
|
@@ -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 initial flood point is out of bounds, do nothing
|
||||||
if (c != 0 && (x < CELL || x >= XRES-CELL || y < CELL || y >= YRES-CELL))
|
if (c != 0 && (x < CELL || x >= XRES-CELL || y < CELL || y >= YRES-CELL))
|
||||||
return 1;
|
return 1;
|
||||||
|
else if (x < 0 || x >= XRES || y < 0 || y >= YRES)
|
||||||
|
return 1;
|
||||||
if (c==0)
|
if (c==0)
|
||||||
{
|
{
|
||||||
cm = pmap[y][x]&0xFF;
|
cm = pmap[y][x]&0xFF;
|
||||||
if (!cm)
|
if (!cm)
|
||||||
cm = photons[y][x]&0xFF;
|
cm = photons[y][x]&0xFF;
|
||||||
if (!cm)
|
if (!cm && bmap[y/CELL][x/CELL])
|
||||||
return 0;
|
FloodWalls(x, y, WL_ERASE, -1, flags);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
cm = 0;
|
cm = 0;
|
||||||
|
Reference in New Issue
Block a user