|
|
|
@ -407,10 +407,12 @@ command_result revflood(color_ostream &out, vector<string> & params)
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// use base tile (beneath constructions/ice), to avoid bug #1871
|
|
|
|
|
// we don't want constructions or ice to restrict vision (to avoid bug #1871)
|
|
|
|
|
// so use the base tile beneath it
|
|
|
|
|
df::tiletype tt = MCache->baseTiletypeAt(current);
|
|
|
|
|
|
|
|
|
|
// unless the actual tile is a downward stairway
|
|
|
|
|
// UNLESS the actual tile has more visibility than the base
|
|
|
|
|
// i.e. if it's a downward or up/down stairway
|
|
|
|
|
df::tiletype ctt = MCache->tiletypeAt(current);
|
|
|
|
|
switch (tileShape(ctt))
|
|
|
|
|
{
|
|
|
|
@ -422,19 +424,19 @@ command_result revflood(color_ostream &out, vector<string> & params)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool below = 0;
|
|
|
|
|
bool above = 0;
|
|
|
|
|
bool sides = 0;
|
|
|
|
|
bool unhide = 1;
|
|
|
|
|
// by tile shape, determine behavior and action
|
|
|
|
|
bool below = false;
|
|
|
|
|
bool above = false;
|
|
|
|
|
bool sides = false;
|
|
|
|
|
bool unhide = true;
|
|
|
|
|
// By tile shape, determine behavior and action
|
|
|
|
|
switch (tileShape(tt))
|
|
|
|
|
{
|
|
|
|
|
// walls:
|
|
|
|
|
// Walls
|
|
|
|
|
case tiletype_shape::WALL:
|
|
|
|
|
if (from_below)
|
|
|
|
|
unhide = 0;
|
|
|
|
|
unhide = false;
|
|
|
|
|
break;
|
|
|
|
|
// air/free space
|
|
|
|
|
// Open space
|
|
|
|
|
case tiletype_shape::NONE:
|
|
|
|
|
case tiletype_shape::EMPTY:
|
|
|
|
|
case tiletype_shape::RAMP_TOP:
|
|
|
|
@ -443,7 +445,7 @@ command_result revflood(color_ostream &out, vector<string> & params)
|
|
|
|
|
case tiletype_shape::BROOK_TOP:
|
|
|
|
|
above = below = sides = true;
|
|
|
|
|
break;
|
|
|
|
|
// has floor
|
|
|
|
|
// Floors
|
|
|
|
|
case tiletype_shape::FORTIFICATION:
|
|
|
|
|
case tiletype_shape::STAIR_UP:
|
|
|
|
|
case tiletype_shape::RAMP:
|
|
|
|
@ -458,14 +460,17 @@ command_result revflood(color_ostream &out, vector<string> & params)
|
|
|
|
|
case tiletype_shape::BROOK_BED:
|
|
|
|
|
case tiletype_shape::ENDLESS_PIT:
|
|
|
|
|
if (from_below)
|
|
|
|
|
unhide = 0;
|
|
|
|
|
unhide = false;
|
|
|
|
|
else
|
|
|
|
|
above = sides = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
// Special case for trees - always reveal them as if they were floor tiles
|
|
|
|
|
if (tileMaterial(tt) == tiletype_material::PLANT || tileMaterial(tt) == tiletype_material::MUSHROOM)
|
|
|
|
|
{
|
|
|
|
|
if (from_below)
|
|
|
|
|
unhide = 0;
|
|
|
|
|
unhide = false;
|
|
|
|
|
else
|
|
|
|
|
above = sides = true;
|
|
|
|
|
}
|
|
|
|
|
if (unhide)
|
|
|
|
@ -475,6 +480,7 @@ command_result revflood(color_ostream &out, vector<string> & params)
|
|
|
|
|
}
|
|
|
|
|
if (sides)
|
|
|
|
|
{
|
|
|
|
|
// Scan adjacent tiles clockwise, starting toward east
|
|
|
|
|
flood.push(foo(DFCoord(current.x + 1, current.y , current.z), false));
|
|
|
|
|
flood.push(foo(DFCoord(current.x + 1, current.y + 1, current.z), false));
|
|
|
|
|
flood.push(foo(DFCoord(current.x , current.y + 1, current.z), false));
|
|
|
|
|