Compare commits

...

5 Commits

Author SHA1 Message Date
Alexsandro Percy f50eca3c80
Merge pull request #4 from MrRar/main
Add support for new automobiles painter
2022-08-13 16:57:58 -03:00
Johannes Fritz 2c83cdc807 Add support for new automobiles painter 2022-08-10 12:30:21 -05:00
Alexsandro Percy 7162a0fb35 check accell values before apply 2022-08-10 10:44:57 -03:00
Alexsandro Percy 8af820a654 fix sound issues 2022-07-03 19:16:37 -03:00
Alexsandro Percy e054616062 entities.lua 2022-07-03 17:37:50 -03:00
3 changed files with 13 additions and 4 deletions

View File

@ -76,7 +76,10 @@ function pa28.physics(self)
if new_velocity then
new_velocity = vector.add(new_velocity, vector.multiply(self._last_accell, self.dtime))
if new_velocity.x == nil then new_velocity.x = 0 end
if new_velocity.y == nil then new_velocity.y = 0 end
if new_velocity.z == nil then new_velocity.z = 0 end
--[[
new_velocity correction
under some circunstances the velocity exceeds the max value accepted by set_velocity and

View File

@ -188,6 +188,10 @@ minetest.register_entity("pa28:pa28", {
_inv = nil,
_inv_id = "",
_change_color = function(self, colstr)
airutils.paint(self, colstr, "pa28_painting.png")
end,
get_staticdata = function(self) -- unloaded/unloads ... is now saved
return minetest.serialize({
--stored_sound_handle = self.sound_handle,
@ -208,6 +212,7 @@ minetest.register_entity("pa28:pa28", {
on_deactivate = function(self)
airutils.save_inventory(self)
if(self.sound_handle) then minetest.sound_stop(self.sound_handle) end
end,
on_activate = function(self, staticdata, dtime_s)
@ -286,6 +291,7 @@ minetest.register_entity("pa28:pa28", {
else
self.inv = inv
end
if self._engine_running == true then pa28.engineSoundPlay(self) end
end,
--on_step = airutils.stepfunc,

View File

@ -46,12 +46,12 @@ function pa28.attach(self, player, instructor_mode)
player:set_eye_offset({x = 0, y = eye_y, z = 2}, {x = 0, y = 1, z = -30})
player_api.player_attached[name] = true
player_api.set_animation(player, "sit")
--player:set_physics_override({gravity = 0})
-- make the driver sit
minetest.after(1, function()
if player then
--minetest.chat_send_all("okay")
player_api.set_animation(player, "sit")
airutils.sit(player)
--apply_physics_override(player, {speed=0,gravity=0,jump=0})
end
@ -92,11 +92,11 @@ function pa28.attach_pax(self, player, is_copilot)
player:set_attach(self.co_pilot_seat_base, "", {x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
player:set_eye_offset({x = 0, y = eye_y, z = 2}, {x = 0, y = 3, z = -30})
player_api.player_attached[name] = true
player_api.set_animation(player, "sit")
-- make the driver sit
minetest.after(0.3, function()
player = minetest.get_player_by_name(name)
if player then
player_api.set_animation(player, "sit")
airutils.sit(player)
--apply_physics_override(player, {speed=0,gravity=0,jump=0})
end
@ -124,11 +124,11 @@ function pa28.attach_pax(self, player, is_copilot)
player:set_eye_offset({x = 0, y = eye_y, z = 0}, {x = 0, y = 3, z = -30})
end
player_api.player_attached[name] = true
player_api.set_animation(player, "sit")
-- make the driver sit
minetest.after(0.3, function()
player = minetest.get_player_by_name(name)
if player then
player_api.set_animation(player, "sit")
airutils.sit(player)
--apply_physics_override(player, {speed=0,gravity=0,jump=0})
end