Skip to content

Commit

Permalink
fix navmesh not finishing compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
Python1320 committed Oct 14, 2021
1 parent 495380b commit f82e813
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions extras/navmesh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f82e813

Please sign in to comment.