various fixes
|
@ -185,6 +185,7 @@ minetest.register_entity('ap_airship:control_interactor',{
|
|||
textures = {"ap_airship_alpha.png",},
|
||||
},
|
||||
dist_moved = 0,
|
||||
max_hp = 65535,
|
||||
|
||||
on_activate = function(self,std)
|
||||
self.sdata = minetest.deserialize(std) or {}
|
||||
|
@ -217,6 +218,7 @@ minetest.register_entity('ap_airship:cabin_interactor',{
|
|||
textures = {"ap_airship_alpha.png",},
|
||||
},
|
||||
dist_moved = 0,
|
||||
max_hp = 65535,
|
||||
|
||||
on_activate = function(self,std)
|
||||
self.sdata = minetest.deserialize(std) or {}
|
||||
|
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
@ -98,7 +98,7 @@ function ap_airship.rescueConnectionFailedPassengers(self)
|
|||
if player then --we have a player!
|
||||
if player_api.player_attached[self._passengers[i]] == nil then --but isn't attached?
|
||||
--minetest.chat_send_all("okay")
|
||||
if player:get_hp() > 0 then
|
||||
if player:get_hp() >= 0 then
|
||||
self._passengers[i] = nil --clear the slot first
|
||||
do_attach(self, player, i) --attach
|
||||
else
|
||||
|
@ -114,10 +114,10 @@ end
|
|||
-- attach passenger
|
||||
function ap_airship.attach_pax(self, player, slot)
|
||||
slot = slot or 0
|
||||
local name = player:get_player_name()
|
||||
|
||||
--verify if is locked to non-owners
|
||||
if self._passengers_locked == true then
|
||||
local name = player:get_player_name()
|
||||
local can_bypass = minetest.check_player_privs(player, {protection_bypass=true})
|
||||
local is_shared = false
|
||||
if name == self.owner or can_bypass then is_shared = true end
|
||||
|
@ -156,6 +156,11 @@ function ap_airship.attach_pax(self, player, slot)
|
|||
i = t[k]
|
||||
if self._passengers[i] == nil then
|
||||
do_attach(self, player, i)
|
||||
if name == self.owner then
|
||||
--put the owner on cabin directly
|
||||
self._passengers_base_pos[i] = {x=0,y=-29,z=150}
|
||||
self._passengers_base[i]:set_attach(self.object,'',self._passengers_base_pos[i],{x=0,y=0,z=0})
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
|
|
|
@ -42,12 +42,13 @@ local function is_obstacle_zone(pos, start_point, end_point)
|
|||
return retVal
|
||||
end
|
||||
|
||||
if pos.z < max_z and pos.z > min_z+mid_z and
|
||||
local death_zone = 1.5 --to avoid the "slip" when colliding in y direction
|
||||
if pos.z < max_z + death_zone and pos.z > min_z+mid_z and
|
||||
pos.x > min_x and pos.x < max_x then
|
||||
retVal.z = max_z + 1
|
||||
return retVal
|
||||
end
|
||||
if pos.z > min_z and pos.z <= min_z+mid_z and
|
||||
if pos.z > min_z - death_zone and pos.z <= min_z+mid_z and
|
||||
pos.x > min_x and pos.x < max_x then
|
||||
retVal.z = min_z - 1
|
||||
return retVal
|
||||
|
@ -66,7 +67,6 @@ function ap_airship.cabin_map(pos, dpos)
|
|||
new_pos = is_obstacle_zone(new_pos, {x=12, z=140}, {x=2.5, z=130})
|
||||
new_pos = is_obstacle_zone(new_pos, {x=-12, z=140}, {x=-2.5, z=130})
|
||||
new_pos = is_obstacle_zone(new_pos, {x=12, z=127}, {x=2.5, z=117})
|
||||
new_pos = is_obstacle_zone(new_pos, {x=-12, z=127}, {x=-2.5, z=117})
|
||||
|
||||
--limit to the cabin
|
||||
new_pos.z = ap_airship.clamp(new_pos.z, 112, 164)
|
||||
|
@ -120,7 +120,7 @@ function ap_airship.ladder_map(pos, dpos)
|
|||
local orig_pos = ap_airship.copy_vector(pos)
|
||||
local position = ap_airship.copy_vector(dpos)
|
||||
local new_pos = ap_airship.copy_vector(dpos)
|
||||
new_pos.z = ap_airship.clamp(new_pos.z, 112, 118)
|
||||
new_pos.z = ap_airship.clamp(new_pos.z, 112, 117)
|
||||
new_pos.x = ap_airship.clamp(new_pos.x, -8.42, -2)
|
||||
|
||||
return new_pos
|
||||
|
|