Another flag is useful here

develop
simon 2010-04-26 17:19:20 +02:00
parent f5d52661b6
commit bc08be3cbb
4 changed files with 14 additions and 2 deletions

@ -265,6 +265,7 @@ namespace DFHack
int16_t typeA;
int16_t typeB;
int16_t typeC;
int32_t typeD;
uint32_t flags;
};
struct t_job

@ -375,6 +375,7 @@ bool Creatures::ReadJob(const t_creature * furball, vector<t_material> & mat)
mat[i].typeA = p->readWord(cmats[i] + minfo->getOffset("job_material_maintype"));
mat[i].typeB = p->readWord(cmats[i] + minfo->getOffset("job_material_sectype1"));
mat[i].typeC = p->readWord(cmats[i] + minfo->getOffset("job_material_sectype2"));
mat[i].typeD = p->readDWord(cmats[i] + minfo->getOffset("job_material_sectype3"));
mat[i].flags = p->readDWord(cmats[i] + minfo->getOffset("job_material_flags"));
}
return true;

@ -262,7 +262,13 @@ void printCreature(DFHack::API & DF, const DFHack::t_creature & creature)
maintype = (char*)"block";
break;
case 3:
maintype = (char*)"rough gem/glass";
switch(mat[i].typeC)
{
case 3: maintype = (char*)"raw green glass"; break;
case 4: maintype = (char*)"raw clear glass"; break;
case 5: maintype = (char*)"raw crystal glass"; break;
default: maintype = (char*)"raw gems"; break;
}
break;
case 4:
maintype = (char*)"raw stone";
@ -270,6 +276,9 @@ void printCreature(DFHack::API & DF, const DFHack::t_creature & creature)
case 5:
maintype = (char*)"wood log";
break;
case 24:
maintype = (char*)"weapon?";
break;
case 54:
maintype = (char*)"leather";
break;
@ -280,7 +289,7 @@ void printCreature(DFHack::API & DF, const DFHack::t_creature & creature)
maintype = (char*)"unknown";
break;
}
printf("\t%s(%d)\t%d %d - %.8x\n", maintype, mat[i].typeA, mat[i].typeB, mat[i].typeC, mat[i].flags);
printf("\t%s(%d)\t%d %d %d - %.8x\n", maintype, mat[i].typeA, mat[i].typeB, mat[i].typeC, mat[i].typeD, mat[i].flags);
}
}
}

@ -1429,6 +1429,7 @@ map_data_1b60_offset 0x1B9c
<Offset name="job_material_maintype">0x0</Offset> like mood materials, 0=bars, 4=stone, 5=wood, 57=cloth, 54=leather ...
<Offset name="job_material_sectype1">0x2</Offset> always -1
<Offset name="job_material_sectype2">0x4</Offset> subtype ?
<Offset name="job_material_sectype3">0x8</Offset> subtype ?
<Offset name="job_material_flags">0x18</Offset> set only for shell / bone mood requirements ?
Materials