From 0d0c25f2c418e215a1b4fe3c8e32d3df8167aad6 Mon Sep 17 00:00:00 2001 From: Sumyjkl Date: Tue, 6 Jun 2023 10:34:57 +1000 Subject: [PATCH] fix obvious crash --- .vscode/launch.json | 26 ++++++++++++++++++++++++++ balloon.lua | 12 ++++++------ 2 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..b522eb7 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Debug Lua Interpreter", + "type": "lua-local", + "request": "launch", + "program": { + "lua": "lua", + "file": "${file}" + } + }, + { + "name": "Debug Custom Lua Environment", + "type": "lua-local", + "request": "launch", + "program": { + "command": "command" + }, + "args": [] + } + ] +} \ No newline at end of file diff --git a/balloon.lua b/balloon.lua index b4e28cc..a43241a 100644 --- a/balloon.lua +++ b/balloon.lua @@ -311,12 +311,12 @@ function ship.on_step(self, dtime, moveresult) end if pi then - if pi.ctrl.up then forward = 1 - elseif pi.ctrl.down then forward = -1 end - if pi.ctrl.jump then climb = 1 - elseif pi.ctrl.aux1 then climb = -1 end - if pi.ctrl.right then right = 1 - elseif pi.ctrl.left then right = -1 end + if pi.up then forward = 1 + elseif pi.down then forward = -1 end + if pi.jump then climb = 1 + elseif pi.aux1 then climb = -1 end + if pi.right then right = 1 + elseif pi.left then right = -1 end local yaw = self.object:get_yaw() local dir = minetest.yaw_to_dir(yaw)