1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-28 04:40:22 +02:00

Fix some placer nil checks

This commit is contained in:
sfan5
2024-01-11 15:50:36 +01:00
committed by GitHub
parent a3b171e317
commit 70cf7a26fd
6 changed files with 18 additions and 18 deletions

View File

@ -413,7 +413,8 @@ minetest.register_craftitem("carts:cart", {
minetest.sound_play({name = "default_place_node_metal", gain = 0.5},
{pos = pointed_thing.above}, true)
if not minetest.is_creative_enabled(placer:get_player_name()) then
local player_name = placer and placer:get_player_name() or ""
if not minetest.is_creative_enabled(player_name) then
itemstack:take_item()
end
return itemstack