adjust price of vermin swarms

develop
Myk Taylor 2023-10-27 22:23:51 -07:00
parent fd63e28f39
commit 4e864ae2dc
No known key found for this signature in database
2 changed files with 7 additions and 2 deletions

@ -58,6 +58,7 @@ Template for new versions:
## Fixes ## Fixes
- `stockpiles`: hide configure and help buttons when the overlay panel is minimized - `stockpiles`: hide configure and help buttons when the overlay panel is minimized
- `caravan`: price of vermin swarms correctly adjusted down. a stack of 10000 is worth 1, not 10000
## Misc Improvements ## Misc Improvements
- `buildingplan`: display how many items are available on the planner panel - `buildingplan`: display how many items are available on the planner panel

@ -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) {
divisor = creature->caste[mat_subtype]->misc.petvalue_divisor; 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;
}
if (divisor > 1) if (divisor > 1)
value /= divisor; value /= divisor;
} }