|
|
@ -25,7 +25,9 @@ int main (void)
|
|
|
|
int32_t oldT, newT;
|
|
|
|
int32_t oldT, newT;
|
|
|
|
int16_t t;
|
|
|
|
int16_t t;
|
|
|
|
|
|
|
|
|
|
|
|
int dirty=0, count=0;
|
|
|
|
bool dirty= false;
|
|
|
|
|
|
|
|
int count=0;
|
|
|
|
|
|
|
|
int countbad=0;
|
|
|
|
|
|
|
|
|
|
|
|
DFHack::ContextManager DFMgr("Memory.xml");
|
|
|
|
DFHack::ContextManager DFMgr("Memory.xml");
|
|
|
|
DFHack::Context *DF = DFMgr.getSingleContext();
|
|
|
|
DFHack::Context *DF = DFMgr.getSingleContext();
|
|
|
@ -71,7 +73,7 @@ int main (void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (Mapz->isValidBlock(x,y,z))
|
|
|
|
if (Mapz->isValidBlock(x,y,z))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
dirty=0;
|
|
|
|
dirty= false;
|
|
|
|
Mapz->ReadDesignations(x,y,z, &designations);
|
|
|
|
Mapz->ReadDesignations(x,y,z, &designations);
|
|
|
|
Mapz->ReadTileTypes(x,y,z, &tiles);
|
|
|
|
Mapz->ReadTileTypes(x,y,z, &tiles);
|
|
|
|
if (Mapz->isValidBlock(x,y,z+1))
|
|
|
|
if (Mapz->isValidBlock(x,y,z+1))
|
|
|
@ -107,10 +109,16 @@ int main (void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tilesAbove[tx][ty] = 32;
|
|
|
|
tilesAbove[tx][ty] = 32;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dirty= true;
|
|
|
|
dirty=-1;
|
|
|
|
|
|
|
|
++count;
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ramp fixer
|
|
|
|
|
|
|
|
else if(DFHack::RAMP!=DFHack::tileTypeTable[oldT].c && DFHack::RAMP_TOP == DFHack::tileTypeTable[tilesAbove[tx][ty]].c)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
tilesAbove[tx][ty] = 32;
|
|
|
|
|
|
|
|
countbad++;
|
|
|
|
|
|
|
|
dirty = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//If anything was changed, write it all.
|
|
|
|
//If anything was changed, write it all.
|
|
|
@ -122,6 +130,7 @@ int main (void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Mapz->WriteTileTypes(x,y,z+1, &tilesAbove);
|
|
|
|
Mapz->WriteTileTypes(x,y,z+1, &tilesAbove);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dirty = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -129,6 +138,7 @@ int main (void)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DF->Detach();
|
|
|
|
DF->Detach();
|
|
|
|
cout << "Found and changed " << count << " tiles." << endl;
|
|
|
|
cout << "Found and changed " << count << " tiles." << endl;
|
|
|
|
|
|
|
|
cout << "Fixed " << countbad << " bad down ramps." << endl;
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
cout << "Done. Press any key to continue" << endl;
|
|
|
|
cout << "Done. Press any key to continue" << endl;
|
|
|
|
cin.ignore();
|
|
|
|
cin.ignore();
|
|
|
|