From cfd5a254004d69f8d5f8b352cb9a1065f29a9ec0 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Wed, 4 May 2011 17:24:20 -0600 Subject: [PATCH 1/2] Properly check each tile for local and global features --- tools/supported/prospector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/supported/prospector.cpp b/tools/supported/prospector.cpp index 4ecb7201b..db53d5eba 100644 --- a/tools/supported/prospector.cpp +++ b/tools/supported/prospector.cpp @@ -278,7 +278,7 @@ int main(int argc, char *argv[]) veinMats[b->veinMaterialAt(coord)]++; break; case DFHack::FEATSTONE: - if (blockFeatureLocal) + if (blockFeatureLocal && des.bits.feature_local) { if (blockFeatureLocal->type == DFHack::feature_Adamantine_Tube && blockFeatureLocal->main_material == 0) // stone @@ -292,7 +292,7 @@ int main(int argc, char *argv[]) } } - if (showSlade && blockFeatureGlobal + if (showSlade && blockFeatureGlobal && des.bits.feature_global && blockFeatureGlobal->type == DFHack::feature_Underworld && blockFeatureGlobal->main_material == 0) // stone { From 2e47e1f039035d443f2427b906bb171d0ed0bd5c Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Thu, 5 May 2011 20:10:45 -0600 Subject: [PATCH 2/2] Add support for EOF on input Also remove unneeded indent in Windows-only blocks. --- tools/supported/liquids.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/supported/liquids.cpp b/tools/supported/liquids.cpp index 17e6d440f..0be65e031 100644 --- a/tools/supported/liquids.cpp +++ b/tools/supported/liquids.cpp @@ -166,7 +166,7 @@ int main (int argc, char** argv) { cerr << e.what() << endl; #ifndef LINUX_BUILD - cin.ignore(); + cin.ignore(); #endif return 1; } @@ -184,6 +184,11 @@ int main (int argc, char** argv) string command = ""; cout <<"[" << mode << ":" << brushname << ":" << amount << ":" << flowmode << ":" << setmode << "]# "; getline(cin, command); + if (std::cin.eof()) + { + command = "q"; + std::cout << std::endl; // No newline from the user here! + } if(command=="help" || command == "?") { cout << "Modes:" << endl @@ -492,11 +497,11 @@ int main (int argc, char** argv) } DF->Detach(); #ifndef LINUX_BUILD - if(!quiet) - { - cout << "Done. Press any key to continue" << endl; - cin.ignore(); - } + if(!quiet) + { + cout << "Done. Press any key to continue" << endl; + cin.ignore(); + } #endif return 0; }