Merge pull request #54 from IFRFSX/master

Allows to get vehicles in low health conditions
master
D00Med 2021-09-20 07:20:48 +10:00 committed by GitHub
commit 50c97b0265
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -745,7 +745,7 @@ function vehicles.on_punch(self, puncher)
end
if not self.driver then return end
local creative_mode = creative and creative.is_enabled_for and creative.is_enabled_for(self.driver:get_player_name())
if self.driver == puncher and (hp == self.hp_max-5 or hp == self.hp_max or creative_mode) then
if self.driver == puncher then
local name = self.object:get_luaentity().name
local pos = self.object:getpos()
minetest.env:add_item(pos, name.."_spawner")