diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-11-02 11:57:16 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-11-02 11:57:16 +0100 |
commit | 7cbe42b1dd0051a0c8a516700c2ef63f1ec090fc (patch) | |
tree | d1da9ae45e2d891adf865853b267c592d5e8ca26 /builtin/client/util.lua | |
parent | 8bc7d49b32afb215d262d8282988adf9e836396c (diff) | |
download | dragonfireclient-7cbe42b1dd0051a0c8a516700c2ef63f1ec090fc.tar.xz |
Re-Added Chat Effects
Diffstat (limited to 'builtin/client/util.lua')
-rw-r--r-- | builtin/client/util.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin/client/util.lua b/builtin/client/util.lua index 20e0e1d1b..783d0ceb1 100644 --- a/builtin/client/util.lua +++ b/builtin/client/util.lua @@ -42,6 +42,11 @@ end function core.get_pointed_thing() local pos = core.camera:get_pos() local pos2 = vector.add(pos, vector.multiply(core.camera:get_look_dir(), 5)) - local ray = core.raycast(pos, pos2, true, core.settings:get_bool("point_liquids") or core.get_item_def(core.localplayer:get_wielded_item():get_name()).liquids_pointable) - return ray:next() + local player = core.localplayer + if not player then return end + local item = player:get_wielded_item() + if not item then return end + local def = core.get_item_def(item:get_name()) + local ray = core.raycast(pos, pos2, true, core.settings:get_bool("point_liquids") or def and def.liquids_pointable) + return ray and ray:next() end |