summaryrefslogtreecommitdiff
path: root/plugins/dig.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-04-10 18:21:19 +0400
committerAlexander Gavrilov2012-04-10 18:21:19 +0400
commitb15d2da819b434f94dc7bd2cd22bbab93c992565 (patch)
tree8eee470ad903ccdbcd3a558b54f64a7b69a07316 /plugins/dig.cpp
parent249be0c1a0e267e806a8b0b1342f1f58f53e44fd (diff)
downloaddfhack-b15d2da819b434f94dc7bd2cd22bbab93c992565.tar.gz
dfhack-b15d2da819b434f94dc7bd2cd22bbab93c992565.tar.bz2
dfhack-b15d2da819b434f94dc7bd2cd22bbab93c992565.tar.xz
Get rid of some obsolete api functions, and restructure MapCache.
Diffstat (limited to 'plugins/dig.cpp')
-rw-r--r--plugins/dig.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/dig.cpp b/plugins/dig.cpp
index 91d963fc..64161a3a 100644
--- a/plugins/dig.cpp
+++ b/plugins/dig.cpp
@@ -90,7 +90,7 @@ bool dig (MapExtras::MapCache & MCache,
{
DFCoord at (x,y,z);
auto b = MCache.BlockAt(at/16);
- if(!b || !b->valid)
+ if(!b || !b->is_valid())
return false;
if(x == 0 || x == x_max * 16 - 1)
{
@@ -1027,6 +1027,8 @@ command_result digv (color_ostream &out, vector <string> & parameters)
{
DFHack::DFCoord current = flood.top();
flood.pop();
+ if (MCache->tagAt(current))
+ continue;
int16_t vmat2 = MCache->veinMaterialAt(current);
tt = MCache->tiletypeAt(current);
if(!DFHack::isWallTerrain(tt))
@@ -1061,7 +1063,8 @@ command_result digv (color_ostream &out, vector <string> & parameters)
}
if(MCache->testCoord(current))
{
- MCache->clearVeinMaterialAt(current);
+ MCache->setTagAt(current, 1);
+
if(current.x < tx_max - 2)
{
flood.push(DFHack::DFCoord(current.x + 1, current.y, current.z));
@@ -1209,6 +1212,8 @@ command_result digl (color_ostream &out, vector <string> & parameters)
{
DFHack::DFCoord current = flood.top();
flood.pop();
+ if (MCache->tagAt(current))
+ continue;
int16_t vmat2 = MCache->veinMaterialAt(current);
int16_t bmat2 = MCache->baseMaterialAt(current);
tt = MCache->tiletypeAt(current);
@@ -1239,7 +1244,7 @@ command_result digl (color_ostream &out, vector <string> & parameters)
if(MCache->testCoord(current))
{
- MCache->clearBaseMaterialAt(current);
+ MCache->setTagAt(current, 1);
if(current.x < tx_max - 2)
{
flood.push(DFHack::DFCoord(current.x + 1, current.y, current.z));