Package: enigma / 1.20-dfsg.1-2.2

bugfix-oldapi-r2382.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
r2382 | raoul-b | 2014-01-18 15:24:05 +0100 (Sa, 18. Jan 2014) | 2 Zeilen

-> Fix a crash occuring for invalid floor tiles in old API levels

------------------------------------------------------------------------
Index: data/api1init.lua
===================================================================
--- enigma-1.20.orig/data/api1init.lua	(Revision 2381)
+++ enigma-1.20/data/api1init.lua	(Revision 2382)
@@ -145,7 +145,7 @@
     fl_wood_framed_v = "fl-stwood2",
     fl_woven = "fl-woven",
     fl_yinyang_yin_invisible = "fl-acblack",
-    fl_yinyang_yang_invisible = "fl-acwhite",    
+    fl_yinyang_yang_invisible = "fl-acwhite",
     it_banana = "it-banana",
     it_bag = "it-bag",
     it_blocker = "it-blocker",
@@ -178,7 +178,7 @@
     it_dynamite = "it-dynamite",
     it_explosion_nil = "it-explosion1",
     it_explosion_hollow = "it-explosion2",
-    it_explosion_debris = "it-explosion3",    
+    it_explosion_debris = "it-explosion3",
     it_extinguisher_empty = "it-extinguisher_empty",
     it_extinguisher_medium = "it-extinguisher_medium",
     it_extinguisher_full = "it-extinguisher",
@@ -461,7 +461,7 @@
     st_pull = "st-pull",
     st_purplegray = "st-rock6",
     st_purplemarble = "st-rock4",
-    
+
     st_puzzle = "st-puzzle",
     st_puzzle_blue_w = "st-puzzle-w",
     st_puzzle_blue_s = "st-puzzle-s",
@@ -707,7 +707,7 @@
 function enigma.GetKind(obj)
     local _newname = enigma.GetClass(obj)
     local _oldname = RenamingObjectsNew2Old[_newname]
-    
+
     if _oldname == nil then
         _oldname = RenamingObjectsNew2Old[enigma._GetKind(obj)]
     end
@@ -788,9 +788,9 @@
 
      if _obj_name == "st-oxyd" then
          if key == "color" then
-	     _val = 0 + val   -- convert to int
+             _val = 0 + val   -- convert to int
              _key = "oxydcolor"
-	 end
+         end
      end
      if key == "connections" then
          if  val == 2  then _val = "w"
@@ -1023,7 +1023,7 @@
          end
          return
      end
-     
+
      if key == "hit_factor" then
          _key = "hit_strength"
      end
@@ -1166,8 +1166,8 @@
      end
      if _obj_name == "st-oxyd" then
          if key == "color" then
-	     val = "" .. val   -- convert to string
-	 end
+             val = "" .. val   -- convert to string
+         end
      end
      if key == "targetx" then
          local d = enigma._GetAttrib(obj, "destination")
@@ -1322,6 +1322,10 @@
     level_width = w
     level_height = h
     world.Resize(w, h)
+
+    -- Make sure there is no tile without a floor.
+    -- Otherwise Enigma crashes in some situations.
+    fill_floor("fl-metal")
 end
 
 
@@ -1350,7 +1354,7 @@
         error("Can't assign attributes, expected table but got "..type(attrs)..".")
     end
     for key,val in pairs(attrs) do
-	set_attrib(obj, key, val)
+        set_attrib(obj, key, val)
     end
 end
 
@@ -1408,7 +1412,7 @@
     if w  == nil then w  = level_width end
     if h  == nil then h  = level_height end
     for y=y0,y0+h-1 do
-	for x=x0,x0+w-1 do
+        for x=x0,x0+w-1 do
             set_floor(name, x, y)
         end
     end
@@ -1416,7 +1420,7 @@
 
 function fill_items(name, x0,y0,w,h)
     for y=y0,y0+h-1 do
-	for x=x0,x0+w-1 do set_item(name, x, y) end
+        for x=x0,x0+w-1 do set_item(name, x, y) end
     end
 end
 
@@ -1429,9 +1433,9 @@
 function draw_floor(name, xy0, xystep, n, attrs)
     local x,y = xy0[1],xy0[2]
     for i=1,n do
-	set_floor(name, x, y, attrs)
-	x = x+xystep[1]
-	y = y+xystep[2]
+        set_floor(name, x, y, attrs)
+        x = x+xystep[1]
+        y = y+xystep[2]
     end
 end
 
@@ -1454,18 +1458,18 @@
 function draw_items(name, xy0, xystep, n, attrs)
     local x,y = xy0[1],xy0[2]
     for i=1,n do
-	set_item(name, x, y, attrs)
-	x = x+xystep[1]
-	y = y+xystep[2]
+        set_item(name, x, y, attrs)
+        x = x+xystep[1]
+        y = y+xystep[2]
     end
 end
 
 function draw_stones(name, xy0, xystep, n, attrs)
     local x,y = xy0[1],xy0[2]
     for i=1,n do
-	set_stone(name, x, y, attrs)
-	x = x+xystep[1]
-	y = y+xystep[2]
+        set_stone(name, x, y, attrs)
+        x = x+xystep[1]
+        y = y+xystep[2]
     end
 end
 
@@ -1482,7 +1486,7 @@
 
 function set_stones(name, poslist, attrs)
     for i,xy in pairs(poslist) do
-	set_stone(name, xy[1], xy[2], attrs)
+        set_stone(name, xy[1], xy[2], attrs)
     end
 end
 
@@ -1684,4 +1688,3 @@
 doorv    = Doorv
 gradient = Gradient
 wormhole = Wormhole
-