Made the behavior of -V a bit more rational
It now only values non-primary commodities in terms of primary ones.
This commit is contained in:
parent
2ae2dc86c6
commit
7f7243ff93
2 changed files with 6 additions and 1 deletions
|
|
@ -264,6 +264,10 @@ commodity_t::varied_history_t::find_price(const commodity_t& source,
|
||||||
if (comm == source)
|
if (comm == source)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Only value secondary commodities in terms of primary ones
|
||||||
|
if (! commodity && ! comm.has_flags(COMMODITY_PRIMARY))
|
||||||
|
continue;
|
||||||
|
|
||||||
DEBUG_INDENT("commodity.prices.find", indent + 1);
|
DEBUG_INDENT("commodity.prices.find", indent + 1);
|
||||||
DEBUG("commodity.prices.find",
|
DEBUG("commodity.prices.find",
|
||||||
"searching for price via commodity '" << comm << "'");
|
"searching for price via commodity '" << comm << "'");
|
||||||
|
|
|
||||||
|
|
@ -351,7 +351,8 @@ public:
|
||||||
, const int indent = 0
|
, const int indent = 0
|
||||||
#endif
|
#endif
|
||||||
) const {
|
) const {
|
||||||
if (base->varied_history && ! has_flags(COMMODITY_WALKED)) {
|
if (! has_flags(COMMODITY_WALKED) && base->varied_history &&
|
||||||
|
(commodity || ! has_flags(COMMODITY_PRIMARY))) {
|
||||||
const_cast<commodity_t&>(*this).add_flags(COMMODITY_WALKED);
|
const_cast<commodity_t&>(*this).add_flags(COMMODITY_WALKED);
|
||||||
optional<price_point_t> point =
|
optional<price_point_t> point =
|
||||||
base->varied_history->find_price(*this, commodity, moment, oldest
|
base->varied_history->find_price(*this, commodity, moment, oldest
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue