From 1a38d4590b56521f2330c09adfb40899b8044df7 Mon Sep 17 00:00:00 2001 From: Fesiug Date: Sat, 30 Dec 2023 21:18:54 -0500 Subject: [PATCH] Don't investigate your allies --- gamemodes/benny/entities/entities/benny_npc_human.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gamemodes/benny/entities/entities/benny_npc_human.lua b/gamemodes/benny/entities/entities/benny_npc_human.lua index 5d2bc27..bd179b3 100644 --- a/gamemodes/benny/entities/entities/benny_npc_human.lua +++ b/gamemodes/benny/entities/entities/benny_npc_human.lua @@ -372,7 +372,12 @@ function ENT:Think() if self:GetState() == "combat" then for ent, data in pairs( self.bEnemyMemory ) do - if !data.GoToLastKnown and data.LastSeenTime+5 < CurTime() then + if !IsValid(ent) then + print("wtf") + self.bEnemyMemory[ent] = nil + continue + end + if self.Faction != ent.Faction and !data.GoToLastKnown and data.LastSeenTime+5 < CurTime() then data.GoToLastKnown = Vector(data.LastPos) self:DebugChat( "Investigating " .. ent:Nick() .. "'s last known position" ) --self:SetState("idle")