From f82e8135c7230275e436fa677496448f0d67acad Mon Sep 17 00:00:00 2001 From: Python1320 Date: Fri, 15 Oct 2021 00:37:15 +0300 Subject: [PATCH] fix navmesh not finishing compiling --- extras/navmesh.lua | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/extras/navmesh.lua b/extras/navmesh.lua index fe7285a..c767922 100644 --- a/extras/navmesh.lua +++ b/extras/navmesh.lua @@ -10,7 +10,7 @@ if not landmark or not landmark.get then end if GetConVar("con_nprint_bgalpha"):GetString()=="quit" then - dbg "quitting..." + dbg("quitting...",CLIENT) RunConsoleCommand("exitgame") if game.ConsoleCommand then game.ConsoleCommand( "exitgame\n" ) @@ -19,18 +19,45 @@ if GetConVar("con_nprint_bgalpha"):GetString()=="quit" then FindMetaTable"Player".ConCommand(NULL,'exitgame',true) end - timer.Simple(5,function() - + -- timer does not run anymore, so sorry... + hook.Add("InitPostEntity","quitalready",function() RunConsoleCommand("exitgame") + + if game.ConsoleCommand then + game.ConsoleCommand( "exitgame\n" ) + end + if CLIENT then + FindMetaTable"Player".ConCommand(NULL,'exitgame',true) + end + end) + -- timer does not run anymore, so sorry... + hook.Add("Initialize","quitalready",function() + RunConsoleCommand("exitgame") + if game.ConsoleCommand then game.ConsoleCommand( "exitgame\n" ) end if CLIENT then FindMetaTable"Player".ConCommand(NULL,'exitgame',true) end + end) + -- timer does not run anymore, so sorry... + local thonk + hook.Add("Think","quitalready",function() + if thonk then return end + thonk=true + RunConsoleCommand("exitgame") + + if game.ConsoleCommand then + game.ConsoleCommand( "exitgame\n" ) + end + if CLIENT then + FindMetaTable"Player".ConCommand(NULL,'exitgame',true) + end end) + return end @@ -128,7 +155,6 @@ hook.Add("Think","agwegwegg",function() game.ConsoleCommand( "exitgame\n" ) end end) - timer.Simple(1,function() dbg"Testing if built" end) timer.Simple(60*2,function() hook.Add("Think",'agwegwegg',function() if navmesh.IsGenerating() then return end