1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-24 01:30:38 +01:00

Nil index check

- Solves #170
This commit is contained in:
LeMagnesium 2015-07-28 18:11:51 +02:00
parent 0f00140d6c
commit 0d88b4443f

View File

@ -33,9 +33,11 @@ function throwing_shoot_arrow (itemstack, player, stiffness, is_cross)
else
minetest.sound_play("throwing_bow_sound", {pos=playerpos})
end
obj:get_luaentity().player = player
obj:get_luaentity().inventory = player:get_inventory()
obj:get_luaentity().stack = player:get_inventory():get_stack("main", player:get_wield_index()-1)
if obj:get_luaentity() then
obj:get_luaentity().player = player
obj:get_luaentity().inventory = player:get_inventory()
obj:get_luaentity().stack = player:get_inventory():get_stack("main", player:get_wield_index()-1)
end
return true
end