mechanic: fix stat unrolling

This commit is contained in:
rr-
2019-01-04 19:49:50 +01:00
parent 9a90b7b7b4
commit bd3f196f84
3 changed files with 4 additions and 9 deletions
+1
View File
@@ -910,6 +910,7 @@ class StatsBuilder:
return stats
def unroll(self) -> Stats:
if len(self.history) > 1:
self.history.pop()
return self.history[-1]
@@ -167,10 +167,7 @@ class ChooseCharacterStatsView(BaseView):
self._stats = self._stats_builder.roll()
elif key == curses.KEY_F6:
try:
self._stats = self._stats_builder.unroll()
except IndexError:
pass
self._render()
-3
View File
@@ -50,10 +50,7 @@ class StatsBox(CustomLineBox):
self.update_values()
def unroll(self) -> None:
try:
self.stats = self.stats_builder.unroll()
except IndexError:
return
self.update_values()
def on_roll_press(self, _user_data: T.Any) -> None: