|
|
@ -57,15 +57,14 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool doPrint(DFHack::dfh_item *itm)
|
|
|
|
virtual bool doPrint(DFHack::dfh_item *itm)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (itm->base->unk1.size() > 0)
|
|
|
|
if (itm->origin->unk1.size() > 0)
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<std::string> refs;
|
|
|
|
std::vector<std::pair<std::string, int32_t> > refs;
|
|
|
|
std::vector<int32_t> values;
|
|
|
|
if (Items->unknownRefs(itm->origin, refs))
|
|
|
|
if (Items->unknownRefs(*itm, refs, values))
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
t_itemflags &f = itm->base->flags;
|
|
|
|
t_itemflags &f = itm->origin->flags;
|
|
|
|
|
|
|
|
|
|
|
|
return (f.unk1 || f.unk2 || f.unk3 || f.unk4 || /*f.unk5 ||*/
|
|
|
|
return (f.unk1 || f.unk2 || f.unk3 || f.unk4 || /*f.unk5 ||*/
|
|
|
|
f.unk6 || f.unk7 ||
|
|
|
|
f.unk6 || f.unk7 ||
|
|
|
@ -77,19 +76,18 @@ public:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::vector<std::string> flags;
|
|
|
|
std::vector<std::string> flags;
|
|
|
|
|
|
|
|
|
|
|
|
t_itemflags &f = itm->base->flags;
|
|
|
|
t_itemflags &f = itm->origin->flags;
|
|
|
|
|
|
|
|
|
|
|
|
if (itm->base->unk1.size() > 0)
|
|
|
|
if (itm->origin->unk1.size() > 0)
|
|
|
|
c->con.print(" vec1: %p\n", itm->base->unk1[0]);
|
|
|
|
c->con.print(" vec1: %p\n", itm->origin->unk1[0]);
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<std::string> refs;
|
|
|
|
std::vector<std::pair<std::string, int32_t> > refs;
|
|
|
|
std::vector<int32_t> values;
|
|
|
|
if (Items->unknownRefs(itm->origin, refs))
|
|
|
|
if (Items->unknownRefs(*itm, refs, values))
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
c->con.print(" refs: ");
|
|
|
|
c->con.print(" refs: ");
|
|
|
|
for (size_t i = 0; i < refs.size(); i++)
|
|
|
|
for (size_t i = 0; i < refs.size(); i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
c->con.print("%s: %d", refs[i].c_str(), values[i]);
|
|
|
|
c->con.print("%s: %d", refs[i].first.c_str(), refs[i].second);
|
|
|
|
if ( (i + 1) < refs.size() )
|
|
|
|
if ( (i + 1) < refs.size() )
|
|
|
|
c->con.print(", ");
|
|
|
|
c->con.print(", ");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -133,11 +131,11 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool doPrint(DFHack::dfh_item *itm)
|
|
|
|
virtual bool doPrint(DFHack::dfh_item *itm)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return (itm->base->x == x && itm->base->y == y && itm->base->z == z
|
|
|
|
return (itm->origin->x == x && itm->origin->y == y && itm->origin->z == z
|
|
|
|
&& itm->base->flags.on_ground
|
|
|
|
&& itm->origin->flags.on_ground
|
|
|
|
&& !itm->base->flags.in_chest
|
|
|
|
&& !itm->origin->flags.in_chest
|
|
|
|
&& !itm->base->flags.in_inventory
|
|
|
|
&& !itm->origin->flags.in_inventory
|
|
|
|
&& !itm->base->flags.in_building);
|
|
|
|
&& !itm->origin->flags.in_building);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
@ -211,7 +209,7 @@ DFhackCExport command_result df_dumpitems (Core * c, vector <string> & parameter
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DFHack::dfh_item itm;
|
|
|
|
DFHack::dfh_item itm;
|
|
|
|
memset(&itm, 0, sizeof(DFHack::dfh_item));
|
|
|
|
memset(&itm, 0, sizeof(DFHack::dfh_item));
|
|
|
|
Items->readItem(p_items[i],itm);
|
|
|
|
Items->copyItem(p_items[i],itm);
|
|
|
|
|
|
|
|
|
|
|
|
if (!chooser->doPrint(&itm))
|
|
|
|
if (!chooser->doPrint(&itm))
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
@ -219,28 +217,28 @@ DFhackCExport command_result df_dumpitems (Core * c, vector <string> & parameter
|
|
|
|
// Print something useful, instead of (-30000,-30000,-30000), if
|
|
|
|
// Print something useful, instead of (-30000,-30000,-30000), if
|
|
|
|
// the item isn't on the ground.
|
|
|
|
// the item isn't on the ground.
|
|
|
|
char location[80];
|
|
|
|
char location[80];
|
|
|
|
if (itm.base->flags.in_chest)
|
|
|
|
if (itm.origin->flags.in_chest)
|
|
|
|
sprintf(location, "chest");
|
|
|
|
sprintf(location, "chest");
|
|
|
|
else if (itm.base->flags.in_inventory)
|
|
|
|
else if (itm.origin->flags.in_inventory)
|
|
|
|
sprintf(location, "inventory");
|
|
|
|
sprintf(location, "inventory");
|
|
|
|
else if (itm.base->flags.in_building)
|
|
|
|
else if (itm.origin->flags.in_building)
|
|
|
|
sprintf(location, "building");
|
|
|
|
sprintf(location, "building");
|
|
|
|
else
|
|
|
|
else
|
|
|
|
sprintf(location, "%d,%d,%d", itm.base->x, itm.base->y,
|
|
|
|
sprintf(location, "%d,%d,%d", itm.origin->x, itm.origin->y,
|
|
|
|
itm.base->z);
|
|
|
|
itm.origin->z);
|
|
|
|
std::string descr;
|
|
|
|
std::string descr;
|
|
|
|
string name1,name2,name0;
|
|
|
|
string name1,name2,name0;
|
|
|
|
itm.base->getItemDescription(&name0, 0);
|
|
|
|
itm.origin->getItemDescription(&name0, 0);
|
|
|
|
itm.base->getItemDescription(&name1, 1);
|
|
|
|
itm.origin->getItemDescription(&name1, 1);
|
|
|
|
itm.base->getItemDescription(&name2, 2);
|
|
|
|
itm.origin->getItemDescription(&name2, 2);
|
|
|
|
c->con.print(
|
|
|
|
c->con.print(
|
|
|
|
"%5d: addr:0x%08x %6d %08x (%s) vptr:0x%08x [%d]\n"
|
|
|
|
"%5d: addr:0x%08x %6d %08x (%s) vptr:0x%08x [%d]\n"
|
|
|
|
" %s\n"
|
|
|
|
" %s\n"
|
|
|
|
" %s\n"
|
|
|
|
" %s\n"
|
|
|
|
" %s\n",
|
|
|
|
" %s\n",
|
|
|
|
i, itm.base, itm.base->id, itm.base->flags.whole,
|
|
|
|
i, itm.origin, itm.origin->id, itm.origin->flags.whole,
|
|
|
|
location,
|
|
|
|
location,
|
|
|
|
((t_virtual *)itm.base)->vptr,
|
|
|
|
((t_virtual *)itm.origin)->vptr,
|
|
|
|
itm.wear_level,
|
|
|
|
itm.wear_level,
|
|
|
|
name0.c_str(),// stacked
|
|
|
|
name0.c_str(),// stacked
|
|
|
|
name1.c_str(),// singular
|
|
|
|
name1.c_str(),// singular
|
|
|
|