floored coords when adding or moving entity spawns
This commit is contained in:
parent
1883bcd78b
commit
feed65cf6d
@ -49,8 +49,8 @@ end
|
|||||||
function moveSpawns(x,y)
|
function moveSpawns(x,y)
|
||||||
for _, spawn in pairs(LoadedObjects.Spawns) do
|
for _, spawn in pairs(LoadedObjects.Spawns) do
|
||||||
if spawn.selected then
|
if spawn.selected then
|
||||||
spawn.args[1] = math.floor(x/game.scale)+Camera.pos.x
|
spawn.args[1] = math.floor((x/game.scale)+Camera.pos.x)
|
||||||
spawn.args[2] = math.floor(y/game.scale)+Camera.pos.y
|
spawn.args[2] = math.floor((y/game.scale)+Camera.pos.y)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -72,6 +72,9 @@ function promptSpawnNew()
|
|||||||
for i=2, #result+1 do
|
for i=2, #result+1 do
|
||||||
print("arg #"..i-1)
|
print("arg #"..i-1)
|
||||||
args[i-1] = result[i]
|
args[i-1] = result[i]
|
||||||
|
if i < 4 then
|
||||||
|
args[i-1] = math.floor(args[i-1])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
args = {0,0}
|
args = {0,0}
|
||||||
|
Loading…
Reference in New Issue
Block a user