From ea106b60641f80a2023606f87364b4b78faa621b Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Sun, 12 Jun 2016 17:24:49 -0700 Subject: [PATCH] Updated to round values that are floats to int Only ints are handled currently, if you throw a float at it, you'll get a stacktrace. This is just a little safety to convert it to an int, so if we somehow get a float (like via database injection/modification), we quietly convert it to the expected format --- gui/patternEditor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/patternEditor.py b/gui/patternEditor.py index 46837ad28..c36a1e80c 100644 --- a/gui/patternEditor.py +++ b/gui/patternEditor.py @@ -239,7 +239,7 @@ class DmgPatternEditorDlg(wx.Dialog): for field in self.DAMAGE_TYPES: edit = getattr(self, "%sEdit" % field) - amount = getattr(p, "%sAmount" % field) + amount = int(round(getattr(p, "%sAmount" % field))) edit.SetValue(amount) self.block = False