.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   YaPB (http://forums.bots-united.com/forumdisplay.php?f=55)
-   -   Modest Suggestion (http://forums.bots-united.com/showthread.php?t=3045)

lewcamino 24-11-2004 05:53

Modest Suggestion
 
First i want to say that i dont know anything about writing or even modifying bots. So take what you can from this post.

I noticed that when using reserved slots in admin-mod there is a bug in the code that calculates when to vacate a slot based on quota and maxplayers. Here is the section of code I think is causing the bug.

Code:

if (g_bBotAutoVacate)
{
if (botcount < g_iBotQuota && count < gpGlobals->maxClients - 1)
BotCreate(NULL, NULL, NULL, NULL, NULL, NULL);

if (count >= gpGlobals->maxClients)
UserKickRandomBot();
}
else
{
if (botcount < g_iBotQuota && count < gpGlobals->maxClients)
BotCreate(NULL, NULL, NULL, NULL, NULL, NULL);
}

The problem occures in a situation simalar to the following;
I have an 9 player server with 1 reserved slot. Thus 8 public slots. If quota is set to 6 and 2 humans connect,
count (now 8) is still less than maxplayers (technically 9.) Ergo the server is full of 6 bots and 2 humans and will remain full until 1 human disconnects.
I dont know exactly how to write this but here is an example;

Code:

 
 if (g_bBotAutoVacate)
{
if (botcount < g_iBotQuota && count < gpGlobals->maxClients - (1 + admin_reserved_slots))
BotCreate(NULL, NULL, NULL, NULL, NULL, NULL);

if (count >= gpGlobals->maxClients - admin_reserved_slots)
UserKickRandomBot();
}
else
{
if (botcount < g_iBotQuota && count < gpGlobals->maxClients - admin_reserved_slots)
BotCreate(NULL, NULL, NULL, NULL, NULL, NULL);
}

I hope that helps, please let me know if that was helpful or if i just dont know enough to help.
Later; Lew

Whistler 25-11-2004 10:41

Re: Modest Suggestion
 
well, I think you may create a separate CVAR for the "admin_reserved_slot"
or if the Admin Mod handles the "admin_reserved_slot" as a CVAR you can just use CVAR_GET_FLOAT() function.


All times are GMT +2. The time now is 23:35.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.