Tool for resetting hidden tile status after botched reveals.

develop
Petr Mrázek 2011-04-10 18:41:49 +02:00
parent b630e93c5a
commit b0b76f6d7c
3 changed files with 13 additions and 21 deletions

@ -207,12 +207,7 @@ class MapCache
}; };
~MapCache() ~MapCache()
{ {
map<DFHack::DFCoord, Block *>::iterator p; trash();
for(p = blocks.begin(); p != blocks.end(); p++)
{
delete p->second;
//cout << stonetypes[p->first].id << " : " << p->second << endl;
}
} }
bool isValid () bool isValid ()
{ {
@ -371,6 +366,15 @@ class MapCache
} }
return true; return true;
} }
void trash()
{
map<DFHack::DFCoord, Block *>::iterator p;
for(p = blocks.begin(); p != blocks.end(); p++)
{
delete p->second;
}
blocks.clear();
}
private: private:
volatile bool valid; volatile bool valid;
volatile bool validgeo; volatile bool validgeo;

@ -17,6 +17,9 @@ ENDIF()
# a reveal clone # a reveal clone
DFHACK_TOOL(dfreveal reveal.cpp) DFHACK_TOOL(dfreveal reveal.cpp)
# re-hide borked reveals
DFHACK_TOOL(dfresethide resethide.cpp)
# designate all visible floor tiles as lair, freezing items in place # designate all visible floor tiles as lair, freezing items in place
DFHACK_TOOL(dflair lair.cpp) DFHACK_TOOL(dflair lair.cpp)

@ -11,26 +11,11 @@ using namespace std;
#include <DFHack.h> #include <DFHack.h>
#include <dfhack/extra/MapExtras.h> #include <dfhack/extra/MapExtras.h>
using namespace MapExtras; using namespace MapExtras;
//#include <argstream.h>
int main (int argc, char* argv[]) int main (int argc, char* argv[])
{ {
// Command line options // Command line options
bool updown = false; bool updown = false;
/*
argstream as(argc,argv);
as >>option('x',"updown",updown,"Dig up and down stairs to reach other z-levels.")
>>help();
// sane check
if (!as.isOk())
{
cout << as.errorLog();
return 1;
}
*/
if(argc > 1 && strcmp(argv[1],"-x") == 0) if(argc > 1 && strcmp(argv[1],"-x") == 0)
updown = true; updown = true;