Skip to content

Commit 6955464

Browse files
committed
Fix background tiles and
1 parent 6294397 commit 6955464

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

enemy.lua

+5-5
Original file line numberDiff line numberDiff line change
@@ -2431,10 +2431,10 @@ function enemy:ifstatement(t, action, arg)
24312431
--EXAMPLE: ["if","speedx","==","speedy","and","jumping","~=",false],["set","speedy"],10
24322432
local statementPass = false
24332433
for i = 1, math.floor(#t/4) do
2434-
local check = t[1]
2434+
local check = t[i]
24352435

24362436
--get properties needed for comparison
2437-
local prop1,prop2 = t[2], t[4]
2437+
local prop1,prop2 = t[i+1], t[i+3]
24382438
if (type(prop1) == "string" and self[prop1]) then
24392439
prop1 = self[prop1]
24402440
elseif (type(prop1) == "table" and prop1[1] and prop1[2] and prop1[1] == "property") then
@@ -2447,16 +2447,16 @@ function enemy:ifstatement(t, action, arg)
24472447
end
24482448

24492449
--comparison
2450-
local comparison = t[3]
2451-
if (not comparison) or type(comparison) ~= "string" then
2450+
local comparison = t[i+2]
2451+
if (not comparison) or (type(comparison) ~= "string") then
24522452
return false
24532453
end
24542454
comparison = comparison:lower()
24552455

24562456
local pass
24572457
if (comparison == "equal" or comparison == "==") and (prop1 == prop2) then
24582458
pass = true
2459-
elseif (comparison == "notequal" or comparison == "!=") and (prop1 ~= prop2) then
2459+
elseif (comparison == "notequal" or comparison == "~=" or comparison == "!=") and (prop1 ~= prop2) then
24602460
pass = true
24612461

24622462
elseif (comparison == "greater" or comparison == ">") and (prop1 > prop2) then

game.lua

+6-2
Original file line numberDiff line numberDiff line change
@@ -4826,9 +4826,12 @@ function loadmap(filename)
48264826
loadentity(t, x, y, r, r[2])
48274827
end
48284828
end
4829-
elseif r[1] == 1 and (not editormode) and android then
4829+
elseif r[1] == 1 and (not editormode) then
48304830
--save memory
4831-
map[x][y] = emptytile
4831+
if (not r["back"]) and (not r["track"]) then
4832+
map[x][y] = nil
4833+
map[x][y] = emptytile
4834+
end
48324835
end
48334836
end
48344837
end
@@ -8281,6 +8284,7 @@ function placeblock(x, y, side)
82818284
end
82828285

82838286
if #checkrect(x-1, y-1, 1, 1, "all") == 0 then
8287+
if map[x][y] == emptytile then map[x][y] = deepcopy(emptytile) end
82848288
map[x][y][1] = tileno
82858289
objects["tile"][tilemap(x, y)] = tile:new(x-1, y-1, 1, 1, true)
82868290
generatespritebatch()

graphics/GUI/androideditorbuttons.png

-15 Bytes
Loading

tiletool.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ end
163163

164164
function tiletool:action(cox, coy)
165165
if map[cox][coy] == emptytile then
166-
map[cox][coy] = shallowcopy(emptytile)
166+
map[cox][coy] = deepcopy(emptytile)
167167
end
168168

169169
if self.func == "remove" then

track.lua

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function track:init(x, y, r)
5050
end
5151
for i = 1, #self.path do
5252
local t = self.path[i]
53+
if map[t[1]][t[2]] == emptytile then map[t[1]][t[2]] = shallowcopy(emptytile) end
5354
map[t[1]][t[2]]["track"] = {start=t[3], ending=t[4], grab=t[5]}
5455
if self.visible == false then
5556
map[t[1]][t[2]]["track"].invisible = true

0 commit comments

Comments
 (0)