From 4e864ae2dc3f8513b74c8c16514f19bead4a2c14 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Fri, 27 Oct 2023 22:23:51 -0700 Subject: [PATCH] adjust price of vermin swarms --- docs/changelog.txt | 1 + library/modules/Items.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 1c0dbd9f2..de74e37b8 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -58,6 +58,7 @@ Template for new versions: ## Fixes - `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 - `buildingplan`: display how many items are available on the planner panel diff --git a/library/modules/Items.cpp b/library/modules/Items.cpp index 944334480..1a9ca1fa6 100644 --- a/library/modules/Items.cpp +++ b/library/modules/Items.cpp @@ -2042,8 +2042,12 @@ int Items::getValue(df::item *item, df::caravan_state *caravan) { int divisor = 1; auto creature = vector_get(world->raws.creatures.all, mat_type); - if (creature && size_t(mat_subtype) < creature->caste.size()) - divisor = creature->caste[mat_subtype]->misc.petvalue_divisor; + 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; + } if (divisor > 1) value /= divisor; }