From 2b5684ece946c0567db5b4431449f90883919800 Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 27 Sep 2012 00:50:44 +0200 Subject: exporting for world change nodes, forgot this before :x --- src/exporter.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/exporter.py b/src/exporter.py index eeca252..e2ee9ae 100644 --- a/src/exporter.py +++ b/src/exporter.py @@ -192,7 +192,7 @@ class KPMapExporter: sectorData = self._packSectorData(sectors) # now that we've got that, we can pack the first part of the file - version = 1 + version = 2 headerSize = 0x2C tsInfoOffsetInHeader = 0x10 data = bytearray(struct.pack('>4sIIIIIIIIII', 'KP_m', version, len(self.layers), headerSize + len(sectorData), 0, 0, 0, headerSize, 0, 0, len(self.map.worlds))) @@ -362,6 +362,12 @@ class KPMapExporter: # i i i b b b b: isNew, Extra pointer, dest map, map ID, foreign ID, transition, padding data += struct.pack('>iiibbbb', 0, 0, 0, node.mapID, node.foreignID, node.transition, 0) + elif node.worldDefID: + data += u32.pack(4) # node type + + # b b b b: world def ID, padding + data += struct.pack('>bbbb', node.worldDefID, 0, 0, 0) + else: data += u32.pack(1) # node type data += zero32 # isNew -- cgit v1.2.3