Allows to get vehicles in low health conditions

master
IFRFSX 2020-10-10 23:52:19 +08:00 committed by GitHub
parent 353f0a5eeb
commit f129248171
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")