From 4c4b6b08e76887783e04abf089cc732d0143af94 Mon Sep 17 00:00:00 2001 From: Fesiug Date: Sun, 31 Dec 2023 00:57:08 -0500 Subject: [PATCH] Handle unknown states --- gamemodes/benny/entities/entities/benny_npc_human.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gamemodes/benny/entities/entities/benny_npc_human.lua b/gamemodes/benny/entities/entities/benny_npc_human.lua index bd179b3..590ea6a 100644 --- a/gamemodes/benny/entities/entities/benny_npc_human.lua +++ b/gamemodes/benny/entities/entities/benny_npc_human.lua @@ -230,7 +230,13 @@ ENT.States = { local result = self:MoveToPos( em.GoToLastKnown, { lookahead = 100, tolerance = 32, draw = true, repath = 0.5 } ) if result == "ok" then em.GoToLastKnown = true - self:DebugChat("Went to last known position") + self:DebugChat("Went to last known position of " .. re:Nick()) + elseif result == "stuck" then + em.GoToLastKnown = true + self:DebugChat("Failed to go to last known position of " .. re:Nick() .. " at " .. tostring(self:GetPos())) + else + em.GoToLastKnown = true + self:DebugChat("Unkown state " .. result .. " while going to " .. re:Nick() .. " at " .. tostring(self:GetPos())) end end end