Fixed miscount in Overitem::prim_count causing the tutorial button to fly around when multiple overitem texts are drawn

This commit is contained in:
Ben Wallis 2021-04-15 21:45:09 +01:00
parent 5445094174
commit 1144eefa46

View File

@ -71,7 +71,11 @@ impl<'a> Ingameable for Overitem<'a> {
// TODO maybe this could be done automatically?
// - 2 Text for name
// - 0 or 2 Rectangle and Text for button
2 + match self.controls.get_binding(GameInput::Interact) {
2 + match self
.controls
.get_binding(GameInput::Interact)
.filter(|_| self.active)
{
Some(_) => 2,
None => 0,
}