From 3c1d16f4972f569a00df891e3fb8301bdbe66b39 Mon Sep 17 00:00:00 2001 From: ineed bots Date: Tue, 12 Mar 2024 15:10:41 -0600 Subject: [PATCH] waittillframeend event --- scripts/mp/bots.gsc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/mp/bots.gsc b/scripts/mp/bots.gsc index dcfe4d6..8d4adc1 100644 --- a/scripts/mp/bots.gsc +++ b/scripts/mp/bots.gsc @@ -1630,12 +1630,22 @@ allowTeamChoice() return true; } +/* + Waits till frame end so that if two notifies happen in the same frame, the other will not be missed. +*/ +BotNotifyBotEvent_( msg, a, b, c, d, e, f, g ) +{ + self endon( "disconnect" ); + waittillframeend; // wait for the waittills to setup again + self notify( "bot_event", msg, a, b, c, d, e, f, g ); +} + /* Notify the bot chat message */ BotNotifyBotEvent( msg, a, b, c, d, e, f, g ) { - self notify( "bot_event", msg, a, b, c, d, e, f, g ); + self thread BotNotifyBotEvent_( msg, a, b, c, d, e, f, g ); } /*