From fe593450bbdf7a221258d7fa83a9bdaf2299c7c8 Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Mon, 14 Mar 2022 00:00:47 +0100 Subject: [PATCH] Finish fixing spawnBot --- src/client/component/bots.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/client/component/bots.cpp b/src/client/component/bots.cpp index 0c72ed89..5901e5d4 100644 --- a/src/client/component/bots.cpp +++ b/src/client/component/bots.cpp @@ -62,11 +62,13 @@ namespace bots { spawn_bot(bot_ent->s.entityNum); } - // can cause a stack overflow - // else if (can_add()) // workaround since first bot won't ever spawn - // { - // add_bot(); - // } + else + { + scheduler::once([]() + { + add_bot(); + }, scheduler::pipeline::server, 100ms); + } } }