diff --git a/lib_planes/entities.lua b/lib_planes/entities.lua index d1e618a..ca49604 100644 --- a/lib_planes/entities.lua +++ b/lib_planes/entities.lua @@ -586,7 +586,8 @@ function airutils.on_punch(self, puncher, ttime, toolcaps, dir, damage) -- lets permit destroying on the air local is_flying = not self.colinfo.touching_ground - if is_flying and not puncher:is_player() then + --if is_flying and not puncher:is_player() then + if not puncher:is_player() then damage_vehicle(self, toolcaps, ttime, damage) end --end diff --git a/lib_planes/utilities.lua b/lib_planes/utilities.lua index 283fc29..691bb67 100644 --- a/lib_planes/utilities.lua +++ b/lib_planes/utilities.lua @@ -55,6 +55,14 @@ end -- attach player function airutils.attach(self, player, instructor_mode) + if self._needed_licence then + local can_fly = minetest.check_player_privs(player, self._needed_licence) + if not can_fly then + minetest.chat_send_player(player:get_player_name(), core.colorize('#ff0000', ' >>> You need trhe priv "'..self._needed_licence..'" to fly this plane.')) + return + end + end + instructor_mode = instructor_mode or false local name = player:get_player_name() self.driver_name = name