Skip to content

[botlib] BOTLIB_TrainingBotCountManager defined but never called #289

@darkshade9

Description

@darkshade9

In botlib_spawn.c:2157, a dedicated function for managing bot counts in training mode is defined as a static function but is never called:

static void BOTLIB_TrainingBotCountManager(void) // never called

The bot management dispatch at line 2279-2291 handles training mode (line 2283) with inline logic instead:

} else if (training->value) {
if (bot_connections.total_bots != num_bot_spawns) {
BOTLIB_RemoveBot("ALL");
BOTLIB_BotCountManager(num_bot_spawns);
}
}

The dedicated function contains additional logic (bot_playercount-based scaling) that is bypassed entirely. As a result, the bot_playercount cvar has no effect in training mode.

The compiler confirms: warning: unused function 'BOTLIB_TrainingBotCountManager'

Fix: Replace the inline training mode block with a call to BOTLIB_TrainingBotCountManager(), or remove the dead function if the inline logic is intentional.

Location: src/action/botlib/botlib_spawn.c:2157 and 2283

Metadata

Metadata

Assignees

No one assigned

    Labels

    aq2-tngOnly TNG (server dll) affectedbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions