fix obvious crash

This commit is contained in:
Sumyjkl 2023-06-06 10:34:57 +10:00
parent d48df74c47
commit 0d0c25f2c4
2 changed files with 32 additions and 6 deletions

26
.vscode/launch.json vendored Normal file
View file

@ -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": []
}
]
}

View file

@ -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)