Add is_player to fakePlayer. Prevents grabAndFire-related crashes

This commit is contained in:
SmallJoker 2018-07-03 22:14:32 +02:00
parent ea94718a9a
commit 1a396c707c

View File

@ -170,7 +170,8 @@ local function punch_filter(data, filtpos, filtnode, msg)
local fakePlayer = { local fakePlayer = {
get_player_name = delay(owner), get_player_name = delay(owner),
is_fake_player = ":pipeworks", is_fake_player = ":pipeworks",
get_wielded_item = delay(ItemStack(nil)) get_wielded_item = delay(ItemStack(nil)),
is_player = delay(true)
} -- TODO: use a mechanism as the wielder one } -- TODO: use a mechanism as the wielder one
local dir = pipeworks.facedir_to_right_dir(filtnode.param2) local dir = pipeworks.facedir_to_right_dir(filtnode.param2)
local frompos = vector.subtract(filtpos, dir) local frompos = vector.subtract(filtpos, dir)