|  |  | @ -2,137 +2,151 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |  * Confiscates and dumps garbage owned by dwarfs. |  |  |  |  * Confiscates and dumps garbage owned by dwarfs. | 
			
		
	
		
		
			
				
					
					|  |  |  |  */ |  |  |  |  */ | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <cstdio> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <iostream> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <iomanip> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <sstream> |  |  |  | #include <sstream> | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <climits> |  |  |  | #include <climits> | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <vector> |  |  |  | #include <vector> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | #include <set> | 
			
		
	
		
		
			
				
					
					|  |  |  | using namespace std; |  |  |  | using namespace std; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <DFHack.h> |  |  |  | #include <dfhack/Core.h> | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | #include <dfhack/DFVector.h> |  |  |  | #include <dfhack/Console.h> | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | #include <dfhack/DFTypes.h> |  |  |  | #include <dfhack/Export.h> | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | #include <dfhack/extra/termutil.h> |  |  |  | #include <dfhack/PluginManager.h> | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | #include <vector> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | #include <string> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | #include <dfhack/modules/Maps.h> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | #include <dfhack/modules/Items.h> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | #include <dfhack/modules/Creatures.h> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | #include <dfhack/modules/Materials.h> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | #include <dfhack/modules/Translation.h> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | using namespace DFHack; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | DFhackCExport command_result df_cleanowned (Core * c, vector <string> & parameters); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | DFhackCExport const char * plugin_name ( void ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     return "cleanowned"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     commands.clear(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     commands.push_back(PluginCommand("cleanowned", | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                      "Confiscates and dumps garbage owned by dwarfs.", | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                      df_cleanowned)); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     return CR_OK; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | int main (int argc, char *argv[]) |  |  |  | DFhackCExport command_result plugin_shutdown ( Core * c ) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     return CR_OK; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | typedef std::map <DFCoord, uint32_t> coordmap; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | DFhackCExport command_result df_cleanowned (Core * c, vector <string> & parameters) | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  |     bool temporary_terminal = TemporaryTerminal(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     bool dump_scattered = false; |  |  |  |     bool dump_scattered = false; | 
			
		
	
		
		
			
				
					
					|  |  |  |     bool confiscate_all = false; |  |  |  |     bool confiscate_all = false; | 
			
		
	
		
		
			
				
					
					|  |  |  |     bool dry_run = false; |  |  |  |     bool dry_run = false; | 
			
		
	
		
		
			
				
					
					|  |  |  |     int wear_dump_level = 65536; |  |  |  |     int wear_dump_level = 65536; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     for(int i = 1; i < argc; i++) |  |  |  |     for(int i = 0; i < parameters.size(); i++) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     { |  |  |  |     { | 
			
		
	
		
		
			
				
					
					|  |  |  |         char *arg = argv[i]; |  |  |  |         string & param = parameters[i]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if (arg[0] != '-') |  |  |  |         if(param == "dryrun") | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             continue; |  |  |  |             dry_run = true; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |         else if(param == "scattered") | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         for (; *arg; arg++) { |  |  |  |             dump_scattered = true; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             switch (arg[0]) { |  |  |  |         else if(param == "all") | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             case 'd': |  |  |  |             confiscate_all = true; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 dry_run = true; |  |  |  |         else if(param == "x") | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 break; |  |  |  |             wear_dump_level = 1; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             case 'l': |  |  |  |         else if(param == "X") | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 dump_scattered = true; |  |  |  |             wear_dump_level = 1; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 break; |  |  |  |         else if(param == "?" || param == "help") | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             case 'a': |  |  |  |         { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 confiscate_all = true; |  |  |  |             c->con.print("Oh no! Someone has to write the help text!\n"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 break; |  |  |  |             return CR_OK; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             case 'x': |  |  |  |         } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 wear_dump_level = 1; |  |  |  |         else | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 break; |  |  |  |         { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             case 'X': |  |  |  |             c->con.printerr("Parameter '%s' is not valid. See 'cleanowned help'.\n",param.c_str()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 wear_dump_level = 2; |  |  |  |             return CR_FAILURE; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 break; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     DFHack::Materials *Materials = c->getMaterials(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     DFHack::Items *Items = c->getItems(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     DFHack::Creatures *Creatures = c->getCreatures(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     DFHack::Translation *Tran = c->getTranslation(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     DFHack::Process * p; |  |  |  |     uint32_t num_creatures; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     unsigned int i; |  |  |  |     bool ok = true; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     DFHack::ContextManager DFMgr("Memory.xml"); |  |  |  |     ok &= Materials->ReadAllMaterials(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     DFHack::Context * DF; |  |  |  |     ok &= Creatures->Start(num_creatures); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     try |  |  |  |     ok &= Tran->Start(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     { |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         DF = DFMgr.getSingleContext(); |  |  |  |     vector<t_item *> p_items; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         DF->Attach(); |  |  |  |     ok &= Items->readItemVector(p_items); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     if(!ok) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     catch (exception& e) |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     { |  |  |  |     { | 
			
		
	
		
		
			
				
					
					|  |  |  |         cerr << e.what() << endl; |  |  |  |         c->con.printerr("Can't continue due to offset errors.\n"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if(temporary_terminal) |  |  |  |         c->Resume(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             cin.ignore(); |  |  |  |         return CR_FAILURE; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         return 1; |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     c->con.print("Found total %d items.\n", p_items.size()); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     DFHack::VersionInfo * mem = DF->getMemoryInfo(); |  |  |  |     for (std::size_t i=0; i < p_items.size(); i++) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     DFHack::Materials *Materials = DF->getMaterials(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     DFHack::Items *Items = DF->getItems(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     DFHack::Creatures *Creatures = DF->getCreatures(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     DFHack::Translation *Tran = DF->getTranslation(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     Materials->ReadAllMaterials(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     uint32_t num_creatures; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     Creatures->Start(num_creatures); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     Tran->Start(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     p = DF->getProcess(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     DFHack::OffsetGroup* itemGroup = mem->getGroup("Items"); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     unsigned vector_addr = itemGroup->getAddress("items_vector"); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     DFHack::DfVector <uint32_t> p_items (p, vector_addr); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     uint32_t size = p_items.size(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     printf("Found total %d items.\n", size); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     for (i=0;i<size;i++) |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     { |  |  |  |     { | 
			
		
	
		
		
			
				
					
					|  |  |  |         uint32_t curItem = p_items[i]; |  |  |  |         t_item * curItem = p_items[i]; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         DFHack::dfh_item itm; |  |  |  |         DFHack::dfh_item itm; | 
			
		
	
		
		
			
				
					
					|  |  |  |         Items->readItem(curItem, itm); |  |  |  |         Items->readItem(curItem, itm); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         bool confiscate = false; |  |  |  |         bool confiscate = false; | 
			
		
	
		
		
			
				
					
					|  |  |  |         bool dump = false; |  |  |  |         bool dump = false; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (!itm.base.flags.owned) { |  |  |  |         if (!itm.base->flags.owned) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         { | 
			
		
	
		
		
			
				
					
					|  |  |  |             int32_t owner = Items->getItemOwnerID(itm); |  |  |  |             int32_t owner = Items->getItemOwnerID(itm); | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (owner >= 0) { |  |  |  |             if (owner >= 0) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 printf("Fixing a misflagged item: "); |  |  |  |             { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 c->con.print("Fixing a misflagged item: "); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 confiscate = true; |  |  |  |                 confiscate = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             else |  |  |  |             else | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 continue; |  |  |  |                 continue; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         std::string name = Items->getItemClass(itm.matdesc.itemType); |  |  |  |         std::string name = Items->getItemClass(itm.matdesc.itemType); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (itm.base.flags.rotten) |  |  |  |         if (itm.base->flags.rotten) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         { |  |  |  |         { | 
			
		
	
		
		
			
				
					
					|  |  |  |             printf("Confiscating a rotten item: \t"); |  |  |  |             c->con.print("Confiscating a rotten item: \t"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             confiscate = true; |  |  |  |             confiscate = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         else if (itm.base.flags.on_ground && |  |  |  |         else if (itm.base->flags.on_ground && | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                  (name == "food" || name == "meat" || name == "plant")) |  |  |  |                  (name == "food" || name == "meat" || name == "plant")) | 
			
		
	
		
		
			
				
					
					|  |  |  |         { |  |  |  |         { | 
			
		
	
		
		
			
				
					
					|  |  |  |             printf("Confiscating a dropped foodstuff: \t"); |  |  |  |             c->con.print("Confiscating a dropped foodstuff: \t"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             confiscate = true; |  |  |  |             confiscate = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         else if (itm.wear_level >= wear_dump_level) |  |  |  |         else if (itm.wear_level >= wear_dump_level) | 
			
		
	
		
		
			
				
					
					|  |  |  |         { |  |  |  |         { | 
			
		
	
		
		
			
				
					
					|  |  |  |             printf("Confiscating and dumping a worn item: \t"); |  |  |  |             c->con.print("Confiscating and dumping a worn item: \t"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             confiscate = true; |  |  |  |             confiscate = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |             dump = true; |  |  |  |             dump = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         else if (dump_scattered && itm.base.flags.on_ground) |  |  |  |         else if (dump_scattered && itm.base->flags.on_ground) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         { |  |  |  |         { | 
			
		
	
		
		
			
				
					
					|  |  |  |             printf("Confiscating and dumping litter: \t"); |  |  |  |             c->con.print("Confiscating and dumping litter: \t"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             confiscate = true; |  |  |  |             confiscate = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |             dump = true; |  |  |  |             dump = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         else if (confiscate_all) |  |  |  |         else if (confiscate_all) | 
			
		
	
		
		
			
				
					
					|  |  |  |         { |  |  |  |         { | 
			
		
	
		
		
			
				
					
					|  |  |  |             printf("Confiscating: \t"); |  |  |  |             c->con.print("Confiscating: \t"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             confiscate = true; |  |  |  |             confiscate = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -140,14 +154,14 @@ int main (int argc, char *argv[]) | 
			
		
	
		
		
			
				
					
					|  |  |  |         { |  |  |  |         { | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (!dry_run) { |  |  |  |             if (!dry_run) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (!Items->removeItemOwner(itm, Creatures)) |  |  |  |                 if (!Items->removeItemOwner(itm, Creatures)) | 
			
		
	
		
		
			
				
					
					|  |  |  |                     printf("(unsuccessfully) "); |  |  |  |                     c->con.print("(unsuccessfully) "); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 if (dump) |  |  |  |                 if (dump) | 
			
		
	
		
		
			
				
					
					|  |  |  |                     itm.base.flags.dump = 1; |  |  |  |                     itm.base->flags.dump = 1; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 Items->writeItem(itm); |  |  |  |                 Items->writeItem(itm); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             printf( |  |  |  |             c->con.print( | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 "%s (wear %d)", |  |  |  |                 "%s (wear %d)", | 
			
		
	
		
		
			
				
					
					|  |  |  |                 Items->getItemDescription(itm, Materials).c_str(), |  |  |  |                 Items->getItemDescription(itm, Materials).c_str(), | 
			
		
	
		
		
			
				
					
					|  |  |  |                 itm.wear_level |  |  |  |                 itm.wear_level | 
			
		
	
	
		
		
			
				
					|  |  | @ -167,10 +181,10 @@ int main (int argc, char *argv[]) | 
			
		
	
		
		
			
				
					
					|  |  |  |                     info += std::string(" '") + temp.name.nickname + "'"; |  |  |  |                     info += std::string(" '") + temp.name.nickname + "'"; | 
			
		
	
		
		
			
				
					
					|  |  |  |                 info += " "; |  |  |  |                 info += " "; | 
			
		
	
		
		
			
				
					
					|  |  |  |                 info += Tran->TranslateName(temp.name,false); |  |  |  |                 info += Tran->TranslateName(temp.name,false); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 printf(", owner %s", info.c_str()); |  |  |  |                 c->con.print(", owner %s", info.c_str()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             printf("\n"); |  |  |  |             c->con.print("\n"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | /*
 |  |  |  | /*
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             printf( |  |  |  |             printf( | 
			
		
	
		
		
			
				
					
					|  |  |  |                 "%5d: %08x %08x (%d,%d,%d) #%08x [%d] %s - %s %s\n", |  |  |  |                 "%5d: %08x %08x (%d,%d,%d) #%08x [%d] %s - %s %s\n", | 
			
		
	
	
		
		
			
				
					|  |  | @ -185,10 +199,5 @@ int main (int argc, char *argv[]) | 
			
		
	
		
		
			
				
					
					|  |  |  |                   */ |  |  |  |                   */ | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     if(temporary_terminal) |  |  |  |     return CR_OK; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         cout << "Done. Press any key to continue" << endl; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         cin.ignore(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     return 0; |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |