monsterz (0.7.1-4) 020_fix_blit_crash.diff

Summary

 monsterz.py |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

    
download this patch

Patch contents

Patch to fix crash on startup caused by errors in the blit() function in monsterz.py. See Ubuntu bug #275492 for details.
Index: monsterz-0.7.1/monsterz.py
===================================================================
--- monsterz-0.7.1.orig/monsterz.py	2009-02-08 20:39:58.000000000 +0000
+++ monsterz-0.7.1/monsterz.py	2009-02-08 20:40:03.000000000 +0000
@@ -833,10 +833,10 @@
             pass
         else:
             for x in range(4):
-                for y, p in enumerate(alpha[x]):
-                    alpha[x][y] = p * x / 4
-                for y, p in enumerate(alpha[406 - x - 1]):
-                    alpha[406 - x - 1][y] = p * x / 4
+                for y in range(len(alpha[x])):
+                    alpha[x][y] = alpha[x][y] * x / 4
+                for y in range(len(alpha[406 - x - 1])):
+                    alpha[406 - x - 1][y] = alpha[406 - x - 1][y] * x / 4
             for col in alpha:
                 l = len(col)
                 for y in range(4):
@@ -1291,10 +1291,10 @@
             pass
         else:
             for x in range(10):
-                for y, p in enumerate(alpha[x]):
-                    alpha[x][y] = p * x / 12
-                for y, p in enumerate(alpha[406 - x - 1]):
-                    alpha[406 - x - 1][y] = p * x / 12
+                for y in range(len(alpha[x])):
+                    alpha[x][y] = alpha[x][y] * x / 12
+                for y in range(len(alpha[406 - x - 1])):
+                    alpha[406 - x - 1][y] = alpha[406 - x - 1][y] * x / 12
             del alpha
             scroll.unlock()
         system.blit(scroll, (13, 437))