From f2bc01bae95fa66b9ebbb0d7f14f851ca4a2c7fb Mon Sep 17 00:00:00 2001 From: troido Date: Mon, 13 Nov 2017 14:09:16 +0100 Subject: fixed small terminal sizes --- asciifarm/client/display/healthpad.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'asciifarm/client/display/healthpad.py') diff --git a/asciifarm/client/display/healthpad.py b/asciifarm/client/display/healthpad.py index 2ca0a89..1b5c7e2 100644 --- a/asciifarm/client/display/healthpad.py +++ b/asciifarm/client/display/healthpad.py @@ -35,13 +35,13 @@ class HealthPad: #return 2 def update(self, win, force=False): - if not self.changed and not force: + if not self.changed and not force or not win: return #self.lastView = (x, y, xmax, ymax) self.changed = False height, width = win.getmaxyx() width -= 1 - barEnd = round(self.health/self.maxHealth * width) + barEnd = round(self.health/self.maxHealth * width) if self.maxHealth > 0 else 0 win.erase() win.addstr(0,0,"Health: {}/{}".format(self.health, self.maxHealth)[:width]) if self.colours: -- cgit