Small fixup to 42f087abb

The old `tristate_to_bool` function returned the second argument if the value was `t_unset`. boost::tribool can be converted to bool,
but the intermediate state returns false. In this case, the only usecase of `tristate_to_bool` had true as a second argument, and I had
forgotten to explicitly check for the intermediate state when I switched to boost::tribool.

It might be useful to re-add the `tristate_to_bool` function again if conversions to bool become more common, but for now this simple
check works.
This commit is contained in:
Charles Dang 2017-03-03 10:52:34 +11:00
parent 9a6663f3ec
commit b1ea099da4

View file

@ -816,7 +816,7 @@ const frame_parameters unit_frame::merge_parameters(int current_time, const fram
}
// Convert the tribool to bool
const bool primary = result.primary_frame == true;
const bool primary = result.primary_frame == true || boost::logic::indeterminate(result.primary_frame);
/** The engine provides a default image to use for the unit when none is available */
result.image = current_val.image.is_void() || current_val.image.get_filename().empty()