floored coords when adding or moving entity spawns

This commit is contained in:
lustlion 2022-03-12 18:20:25 +01:00
parent 1883bcd78b
commit feed65cf6d

View File

@ -49,8 +49,8 @@ end
function moveSpawns(x,y)
for _, spawn in pairs(LoadedObjects.Spawns) do
if spawn.selected then
spawn.args[1] = math.floor(x/game.scale)+Camera.pos.x
spawn.args[2] = math.floor(y/game.scale)+Camera.pos.y
spawn.args[1] = math.floor((x/game.scale)+Camera.pos.x)
spawn.args[2] = math.floor((y/game.scale)+Camera.pos.y)
end
end
end
@ -72,6 +72,9 @@ function promptSpawnNew()
for i=2, #result+1 do
print("arg #"..i-1)
args[i-1] = result[i]
if i < 4 then
args[i-1] = math.floor(args[i-1])
end
end
else
args = {0,0}