// IW6 GSC SOURCE
// Generated by https://github.com/xensik/gsc-tool

main()
{
    setup_callbacks();
    setup_bot_grnd();
}

setup_callbacks()
{
    level.bot_funcs["gametype_think"] = ::bot_grnd_think;
}

setup_bot_grnd()
{
    maps\mp\bots\_bots_util::bot_waittill_bots_enabled( 1 );
    level.protect_radius = 128;
    level.bot_gametype_precaching_done = 1;
}

bot_grnd_think()
{
    self notify( "bot_grnd_think" );
    self endon( "bot_grnd_think" );
    self endon( "death" );
    self endon( "disconnect" );
    level endon( "game_ended" );

    while ( !isdefined( level.bot_gametype_precaching_done ) )
        wait 0.05;

    self botsetflag( "separation", 0 );

    for (;;)
    {
        wait 0.05;

        if ( maps\mp\bots\_bots_strategy::bot_has_tactical_goal() )
            continue;

        if ( !self bothasscriptgoal() )
        {
            self botsetscriptgoal( level.grnd_zone.origin, 0, "objective" );
            continue;
        }

        if ( !maps\mp\bots\_bots_util::bot_is_defending() )
        {
            self botclearscriptgoal();
            maps\mp\bots\_bots_strategy::bot_protect_point( level.grnd_zone.origin, level.protect_radius );
        }
    }
}
