mirror of
https://codeberg.org/SumianVoice/sum_airship.git
synced 2025-03-22 15:42:21 +00:00
Update balloon.lua
This commit is contained in:
parent
3a1e84e2ca
commit
d5737a31da
1 changed files with 10 additions and 10 deletions
20
balloon.lua
20
balloon.lua
|
@ -153,12 +153,12 @@ end
|
||||||
|
|
||||||
function me.on_step(self, dtime, moveresult)
|
function me.on_step(self, dtime, moveresult)
|
||||||
local exit = false
|
local exit = false
|
||||||
local ctrl = nil
|
local pi = nil
|
||||||
-- allow to exit
|
-- allow to exit
|
||||||
if self._driver and self._driver:is_player() then
|
if self._driver and self._driver:is_player() then
|
||||||
local name = self._driver:get_player_name()
|
local name = self._driver:get_player_name()
|
||||||
ctrl = player_info.p[name]
|
pi = player_info.p[name]
|
||||||
exit = ctrl.just_pressed.sneak
|
exit = pi.just_pressed.sneak
|
||||||
end
|
end
|
||||||
if exit then
|
if exit then
|
||||||
me.detach(self)
|
me.detach(self)
|
||||||
|
@ -175,13 +175,13 @@ function me.on_step(self, dtime, moveresult)
|
||||||
local in_water = minetest.get_item_group(minetest.get_node(p).name, "liquid") ~= 0
|
local in_water = minetest.get_item_group(minetest.get_node(p).name, "liquid") ~= 0
|
||||||
local on_water = (minetest.get_item_group(minetest.get_node(vector.offset(p, 0, -0.2, 0)).name, "liquid") ~= 0 and not in_water)
|
local on_water = (minetest.get_item_group(minetest.get_node(vector.offset(p, 0, -0.2, 0)).name, "liquid") ~= 0 and not in_water)
|
||||||
|
|
||||||
if ctrl then
|
if pi then
|
||||||
if ctrl.ctrl.up then forward = 1
|
if pi.ctrl.up then forward = 1
|
||||||
elseif ctrl.ctrl.down then forward = -1 end
|
elseif pi.ctrl.down then forward = -1 end
|
||||||
if ctrl.ctrl.jump then climb = 1
|
if pi.ctrl.jump then climb = 1
|
||||||
elseif ctrl.ctrl.aux1 then climb = -1 end
|
elseif pi.ctrl.aux1 then climb = -1 end
|
||||||
if ctrl.ctrl.right then right = 1
|
if pi.ctrl.right then right = 1
|
||||||
elseif ctrl.ctrl.left then right = -1 end
|
elseif pi.ctrl.left then right = -1 end
|
||||||
local yaw = self.object:get_yaw()
|
local yaw = self.object:get_yaw()
|
||||||
local dir = minetest.yaw_to_dir(yaw)
|
local dir = minetest.yaw_to_dir(yaw)
|
||||||
self.object:set_yaw(yaw - right * dtime)
|
self.object:set_yaw(yaw - right * dtime)
|
||||||
|
|
Loading…
Add table
Reference in a new issue