From 45ddd51d67c44b3e1b93252247a9f2bcd589ef78 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Mon, 21 Nov 2022 11:00:12 +1100 Subject: [PATCH] fix(client): ensure valid networked entity for server events Should resolve #46 --- client/main.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/main.lua b/client/main.lua index 1f53db0..b04deee 100644 --- a/client/main.lua +++ b/client/main.lua @@ -67,7 +67,6 @@ local function enableTargeting() end end - if hit and distance < 7 then local newOptions local lastZone = currentZone @@ -305,8 +304,8 @@ local function getResponse(option, server) response.coords = currentTarget.coords response.distance = currentTarget.distance - if server and response.entity then - response.entity = NetworkGetNetworkIdFromEntity(response.entity) + if server then + response.entity = response.entity ~= 0 and NetworkGetEntityIsNetworked(response.entity) and NetworkGetNetworkIdFromEntity(response.entity) or 0 end response.icon = nil