diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 8b13789..0000000 --- a/depends.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/init.lua b/init.lua index ab35576..0e51e88 100644 --- a/init.lua +++ b/init.lua @@ -36,6 +36,7 @@ airutils.fuel = {['biofuel:biofuel'] = 1,['biofuel:bottle_fuel'] = 1, ['airutils:biofuel'] = 1,} airutils.protect_in_areas = minetest.settings:get_bool('airutils_protect_in_areas') +airutils.debug_log = minetest.settings:get_bool('airutils_debug_log') if not minetest.settings:get_bool('airutils_disable_papi') then dofile(minetest.get_modpath("airutils") .. DIR_DELIM .. "airutils_papi.lua") diff --git a/lib_planes/entities.lua b/lib_planes/entities.lua index 776f764..941bb50 100644 --- a/lib_planes/entities.lua +++ b/lib_planes/entities.lua @@ -26,9 +26,14 @@ end function airutils.on_deactivate(self) airutils.save_inventory(self) + local pos = self.object:get_pos() + if airutils.debug_log then + minetest.log("action","deactivating: "..self._vehicle_name.." from "..self.owner.." at position "..pos.x..","..pos.y..","..pos.z) + end end function airutils.on_activate(self, staticdata, dtime_s) + local pos = self.object:get_pos() airutils.actfunc(self, staticdata, dtime_s) self._flap = false @@ -64,6 +69,10 @@ function airutils.on_activate(self, staticdata, dtime_s) self._roll = 0 self._pitch = 0 + if airutils.debug_log then + minetest.log("action","activating: "..self._vehicle_name.." from "..self.owner.." at position "..pos.x..","..pos.y..","..pos.z) + end + if self._register_parts_method then self._register_parts_method(self) end diff --git a/lib_planes/utilities.lua b/lib_planes/utilities.lua index 23a0cef..6e6f20f 100644 --- a/lib_planes/utilities.lua +++ b/lib_planes/utilities.lua @@ -259,6 +259,8 @@ function airutils.destroy(self, by_name) if by_name == self.owner then with_fire = false end local pos = self.object:get_pos() + minetest.log("action","destroying: "..self._vehicle_name.." from "..self.owner.." at position "..pos.x..","..pos.y..","..pos.z) + if self.owner and self._vehicle_name then minetest.log("action", "airutils: The player "..self.owner.." had it's "..self._vehicle_name.." destroyed at position x="..pos.x.." y="..pos.y.." z="..pos.z) else @@ -299,24 +301,6 @@ function airutils.destroy(self, by_name) if airutils.blast_damage == true and with_fire == true then airutils.add_blast_damage(pos, 7, 10) end - - --[[pos.y=pos.y+2 - minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'hidroplane:wings') - - for i=1,6 do - minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'default:steel_ingot') - end - - for i=1,2 do - minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'wool:white') - end - - for i=1,6 do - minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'default:mese_crystal') - minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'default:diamond') - end]]-- - - --minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'hidroplane:hidro') end function airutils.testImpact(self, velocity, position) diff --git a/settingtypes.txt b/settingtypes.txt index e479705..b2ebbcc 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -12,3 +12,6 @@ airutils_disable_tug (disable tug tool) bool false # disable repair tool for planes airutils_disable_repair (planes cannot be repaired) bool false + +# enable debug od activation and deactivation of the vehicle entity +airutils_debug_log (log of entity activation) bool false