diff --git a/docs/plugins/dig.rst b/docs/plugins/dig.rst index 77b3137ae..d6b6451a6 100644 --- a/docs/plugins/dig.rst +++ b/docs/plugins/dig.rst @@ -143,9 +143,10 @@ Designation options: ``clear`` Clear any designations. -You can also pass a ``-z`` option, which restricts designations to the current -z-level and down. This is useful when you don't want to designate tiles on the -same z-levels as your carefully dug fort above. +You can also pass a ``-z`` and/or a ``+z``` option, which restricts designations to the +current z-level and down/up. This is useful when you don't want to designate tiles on the +same z-levels as your carefully dug fort above/below. To dig only at the current z-level, +pass in both. digexp ------ diff --git a/plugins/dig.cpp b/plugins/dig.cpp index 7b0edf7dd..7a92a0851 100644 --- a/plugins/dig.cpp +++ b/plugins/dig.cpp @@ -1424,6 +1424,8 @@ command_result digtype (color_ostream &out, vector & parameters) uint32_t xMax,yMax,zMax; Maps::getSize(xMax,yMax,zMax); + uint32_t zMin = 0; + int32_t targetDigType = -1; for (string parameter : parameters) { if ( parameter == "clear" ) @@ -1442,6 +1444,8 @@ command_result digtype (color_ostream &out, vector & parameters) targetDigType = tile_dig_designation::UpStair; else if ( parameter == "-z" ) zMax = *window_z + 1; + else if ( parameter == "+z") + zMin = *window_z; else { out.printerr("Invalid parameter: '%s'.\n", parameter.c_str()); @@ -1494,7 +1498,7 @@ command_result digtype (color_ostream &out, vector & parameters) if (baseDes.bits.dig == tile_dig_designation::Default) baseOcc.bits.dig_auto = true; else baseOcc.bits.dig_auto = false; - for( uint32_t z = 0; z < zMax; z++ ) + for( uint32_t z = zMin; z < zMax; z++ ) { for( uint32_t x = 1; x < tileXMax-1; x++ ) {