|
|
@ -2042,8 +2042,12 @@ int Items::getValue(df::item *item, df::caravan_state *caravan)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int divisor = 1;
|
|
|
|
int divisor = 1;
|
|
|
|
auto creature = vector_get(world->raws.creatures.all, mat_type);
|
|
|
|
auto creature = vector_get(world->raws.creatures.all, mat_type);
|
|
|
|
if (creature && size_t(mat_subtype) < creature->caste.size())
|
|
|
|
if (creature) {
|
|
|
|
|
|
|
|
if (creature->flags.is_set(df::creature_raw_flags::VERMIN_SOIL_COLONY))
|
|
|
|
|
|
|
|
divisor = 10000;
|
|
|
|
|
|
|
|
else if (size_t(mat_subtype) < creature->caste.size())
|
|
|
|
divisor = creature->caste[mat_subtype]->misc.petvalue_divisor;
|
|
|
|
divisor = creature->caste[mat_subtype]->misc.petvalue_divisor;
|
|
|
|
|
|
|
|
}
|
|
|
|
if (divisor > 1)
|
|
|
|
if (divisor > 1)
|
|
|
|
value /= divisor;
|
|
|
|
value /= divisor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|