Cleanmap tweak: removes broken ammunition

develop
Petr Mrázek 2011-02-21 08:26:40 +01:00
parent dd462fed6c
commit d0c76c8162
2 changed files with 16 additions and 3 deletions

@ -55,6 +55,7 @@ int main (int argc, char** argv)
Mapz->getSize(x_max,y_max,z_max); Mapz->getSize(x_max,y_max,z_max);
uint8_t zeroes [16][16] = {0}; uint8_t zeroes [16][16] = {0};
DFHack::occupancies40d occ;
// walk the map // walk the map
for(uint32_t x = 0; x< x_max;x++) for(uint32_t x = 0; x< x_max;x++)
@ -66,6 +67,13 @@ int main (int argc, char** argv)
if(Mapz->isValidBlock(x,y,z)) if(Mapz->isValidBlock(x,y,z))
{ {
Mapz->ReadVeins(x,y,z,0,0,&splatter); Mapz->ReadVeins(x,y,z,0,0,&splatter);
Mapz->ReadOccupancy(x,y,z,&occ);
for(int i = 0; i < 16; i++)
for(int j = 0; j < 16; j++)
{
occ[i][j].unibits.splatter = 0;
}
Mapz->WriteOccupancy(x,y,z,&occ);
for(uint32_t i = 0; i < splatter.size(); i++) for(uint32_t i = 0; i < splatter.size(); i++)
{ {
DFHack::t_spattervein & vein = splatter[i]; DFHack::t_spattervein & vein = splatter[i];

@ -908,13 +908,18 @@ int main (void)
" 4=string, 5=automated offset search, 6=vector by address in its array,\n" " 4=string, 5=automated offset search, 6=vector by address in its array,\n"
" 7=pointer vector by address of an object, 8=vector>first object>string\n" " 7=pointer vector by address of an object, 8=vector>first object>string\n"
" 9=string buffers, 10=known data, 11=backpointers, 12=data+backpointers\n" " 9=string buffers, 10=known data, 11=backpointers, 12=data+backpointers\n"
" 13=coord lookup\n"; " 13=coord lookup\n"
" 0= exit\n";
int mode; int mode;
bool finish = 0;
do do
{ {
getNumber(prompt,mode, 1, false); getNumber(prompt,mode, 1, false);
switch (mode) switch (mode)
{ {
case 0:
finish = 1;
break;
case 1: case 1:
DF->Detach(); DF->Detach();
FindIntegers(DFMgr, selected_ranges); FindIntegers(DFMgr, selected_ranges);
@ -967,9 +972,9 @@ int main (void)
FindCoords(DFMgr, selected_ranges); FindCoords(DFMgr, selected_ranges);
break; break;
default: default:
cout << "not implemented :(" << endl; cout << "Unknown function, try again." << endl;
} }
} while (mode < 1 || mode > 12 ); } while ( !finish );
#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();