From 2d20849271e37f2afaab832114c0a36fbff45d35 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Fri, 24 Sep 2010 11:41:24 -1000 Subject: [PATCH] pass None to fillBlocks for the area, instead of a giant box --- mce.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/mce.py b/mce.py index 4e7f071..98d43df 100644 --- a/mce.py +++ b/mce.py @@ -228,17 +228,17 @@ class mce(object): blockType = self.readBlockType(command) assert blockType >=0 and blockType < 256 + if len(command): destPoint = self.readPoint(command); destSize = self.readPoint(command, isPoint = False); - else: - box = self.level.getWorldBounds(); - destPoint = box.origin - destSize = box.size + box = BoundingBox(destPoint, destSize) + else: + box = None + print "Filling with {0}".format(self.level.materials.names[blockType]) - box = BoundingBox(destPoint, destSize) self.level.fillBlocks(box, blockType) @@ -269,16 +269,15 @@ class mce(object): if len(command): destPoint = self.readPoint(command); destSize = self.readPoint(command, isPoint = False); + box = BoundingBox(destPoint, destSize) + else: - box = self.level.getWorldBounds(); - destPoint = box.origin - destSize = box.size + box = None print "Replacing {0} with {1}".format(self.level.materials.names[blockType], self.level.materials.names[newBlockType]) - box = BoundingBox(destPoint, destSize) self.level.fillBlocks(box, newBlockType, blockData = 0, blocksToReplace = [blockType]) self.needsSave = True;