From 20cd8201e74a1fae198e6236ede9b29237d82055 Mon Sep 17 00:00:00 2001 From: Caleb Deveraux Date: Tue, 5 Oct 2010 21:54:58 -0600 Subject: [PATCH 1/2] Don't throw in mce.py on fill/replace with an empty box mce.py, when called with an empty box (e.g., request entire world to be changed), would throw an exception, since box is None (and therefore has no volume parameter). This would prevent the ligthting steps from occuring further on. --- mce.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mce.py b/mce.py index e8934d0..5bec290 100755 --- a/mce.py +++ b/mce.py @@ -267,7 +267,7 @@ class mce(object): self.needsSave = True; - print "Filled {0} blocks.".format(box.volume) + print "Filled {0} blocks.".format("all" if box is None else box.volume) def _replace(self, command): """ @@ -305,8 +305,8 @@ class mce(object): self.level.fillBlocks(box, newBlockType, blockData = 0, blocksToReplace = [blockType]) self.needsSave = True; - print "Replaced {0} blocks.".format(box.volume) - + print "Replaced {0} blocks.".format("all" if box is None else box.volume) + def _analyze(self, command): """ analyze From 8becbc066d47dfe3d1679407e9ea5cc9f635b07a Mon Sep 17 00:00:00 2001 From: Caleb Deveraux Date: Tue, 5 Oct 2010 22:02:41 -0600 Subject: [PATCH 2/2] Add regression tests for replace/fill --- run_regression_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/run_regression_test.py b/run_regression_test.py index 9a668d4..97c2aae 100755 --- a/run_regression_test.py +++ b/run_regression_test.py @@ -133,7 +133,9 @@ alpha_tests = [ (do_test, 'baseline', 'ca66277d8037fde5aea3a135dd186f91e4bf4bef', []), (do_test, 'degrief', '6ae14eceab8e0c600799463a77113448b2d9ff8c', ['degrief']), (do_test_match_output, 'analyze', 'f2938515596b88509b2e4c8d598951887d7e0f4c', ['analyze']), - (do_test, 'relight', '00bc507daa3c07fee065973da4b81a099124650f', ['relight']) + (do_test, 'relight', '00bc507daa3c07fee065973da4b81a099124650f', ['relight']), + (do_test, 'replace', 'b26c3d3c05dd873fd8fd29b6b7a38e3ebd9a3e8e', ['replace', 'Water', 'with', 'Lava']), + (do_test, 'fill', 'f9dd5d49789b4c7363bf55eab03b05846e89f89f', ['fill', 'Water']), ] def main(argv):