pass None to fillBlocks for the area, instead of a giant box

This commit is contained in:
David Vierra 2010-09-24 11:41:24 -10:00
parent cb0cddf704
commit 2d20849271

17
mce.py
View File

@ -228,17 +228,17 @@ class mce(object):
blockType = self.readBlockType(command) blockType = self.readBlockType(command)
assert blockType >=0 and blockType < 256 assert blockType >=0 and blockType < 256
if len(command): if len(command):
destPoint = self.readPoint(command); destPoint = self.readPoint(command);
destSize = self.readPoint(command, isPoint = False); destSize = self.readPoint(command, isPoint = False);
else: box = BoundingBox(destPoint, destSize)
box = self.level.getWorldBounds();
destPoint = box.origin
destSize = box.size
else:
box = None
print "Filling with {0}".format(self.level.materials.names[blockType]) print "Filling with {0}".format(self.level.materials.names[blockType])
box = BoundingBox(destPoint, destSize)
self.level.fillBlocks(box, blockType) self.level.fillBlocks(box, blockType)
@ -269,16 +269,15 @@ class mce(object):
if len(command): if len(command):
destPoint = self.readPoint(command); destPoint = self.readPoint(command);
destSize = self.readPoint(command, isPoint = False); destSize = self.readPoint(command, isPoint = False);
box = BoundingBox(destPoint, destSize)
else: else:
box = self.level.getWorldBounds(); box = None
destPoint = box.origin
destSize = box.size
print "Replacing {0} with {1}".format(self.level.materials.names[blockType], print "Replacing {0} with {1}".format(self.level.materials.names[blockType],
self.level.materials.names[newBlockType]) self.level.materials.names[newBlockType])
box = BoundingBox(destPoint, destSize)
self.level.fillBlocks(box, newBlockType, blockData = 0, blocksToReplace = [blockType]) self.level.fillBlocks(box, newBlockType, blockData = 0, blocksToReplace = [blockType])
self.needsSave = True; self.needsSave = True;