From 07250230943a5fdfd7961063478523ee948710f4 Mon Sep 17 00:00:00 2001 From: troido Date: Mon, 6 Nov 2017 21:12:10 +0100 Subject: changed ui places for inventory and ground. fixed bug where small screens would crash game --- asciifarm/client/display/inventorypad.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'asciifarm/client/display/inventorypad.py') diff --git a/asciifarm/client/display/inventorypad.py b/asciifarm/client/display/inventorypad.py index 0b3bdf9..e81f9de 100644 --- a/asciifarm/client/display/inventorypad.py +++ b/asciifarm/client/display/inventorypad.py @@ -20,10 +20,10 @@ class InventoryPad: self.changed = True def getHeight(self): - return len(self.items)+2 + return self.maxItems+2 def update(self, screen, x, y, xmax, ymax): - if not self.changed and (x, y, xmax, ymax) == self.lastView: + if not self.changed and (x, y, xmax, ymax) == self.lastView or xmax <= x or ymax <= y: return self.lastView = (x, y, xmax, ymax) self.changed = False -- cgit