diff pytouhou/formats/ecl.py @ 20:6ebf9539c077

Handle more enemies types and movements
author Thibaut Girka <thib@sitedethib.com>
date Thu, 11 Aug 2011 12:13:48 +0200
parents ca26a84916cb
children 1b0ca2fb89f9
line wrap: on
line diff
--- a/pytouhou/formats/ecl.py
+++ b/pytouhou/formats/ecl.py
@@ -42,9 +42,7 @@ class ECL(object):
                 break
             sub, instr_type, size = unpack('<HHH', file.read(6))
             data = file.read(size - 8)
-            if instr_type == 0: # Normal enemy
-                args = unpack('<ffIhHHH', data)
-            elif instr_type == 2: # Mirrored enemy
+            if instr_type in (0, 2, 4, 6): # Enemy spawn
                 args = unpack('<ffIhHHH', data)
             else:
                 print('ECL: Warning: unknown opcode %d (%r)' % (instr_type, data)) #TODO