From 484eedd4a2be8761accdfdaf0c2ff75a51e4c2f0 Mon Sep 17 00:00:00 2001 From: ineed bots Date: Tue, 12 Mar 2024 14:51:30 -0600 Subject: [PATCH] waittillframeend for event --- maps/bots/_bot_utility.gsc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/maps/bots/_bot_utility.gsc b/maps/bots/_bot_utility.gsc index e81a62f..fd73f62 100644 --- a/maps/bots/_bot_utility.gsc +++ b/maps/bots/_bot_utility.gsc @@ -484,12 +484,22 @@ BotStopMoving( what ) } } +/* + 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 ); } /*