InfdevChunk now ensures that its entities' Motion and Position are lists of doubles. this fixes compatibility with indev worlds, mostly

This commit is contained in:
David Vierra 2011-10-14 10:56:03 -10:00
parent e527de9d7f
commit a3f0b16c47

View File

@ -872,6 +872,19 @@ class InfdevChunk(EntityLevel):
if Entities not in chunkTag[Level]:
chunkTag[Level][Entities] = TAG_List();
def addEntity(self, entityTag):
def doubleize(name):
if name in entityTag:
m = entityTag[name]
entityTag[name] = TAG_List([TAG_Double(i.value) for i in m])
doubleize("Motion")
doubleize("Position")
self.dirty = True
return super(InfdevChunk, self).addEntity(entityTag)
def removeEntitiesInBox(self, box):
self.dirty = True;
return super(InfdevChunk, self).removeEntitiesInBox(box)