Quote:
Originally Posted by stefanhendriks
 ! Finally some good news pmb  Hehe. Well i am glad to hear this.
I was hoping you could shed a light on 'multiple bots working together on metamod'. I know it has something to do with the indexes not being updated properly or something. But i have not taken a look into this properly yet.
I think something like a bool bIsOtherBot is needed, so when a fakeclient is found, but is not created using botCreate it is automaticly an 'otherbot'. Therefor it should not 'think'. But as i said i don't know the exact problems so i cannot say what a fix can be 
|
Actually the solution is simple: put the FL_FAKECLIENT flag (as Turtle Rocker says), but NEVER rely on him to tell if an edict is one of your bots or not.
I.e, never do
Code:
if (pEdict->v.flags & FL_FAKECLIENT)
// this beast is a bot
but do (a la botman)
Code:
int bot_index = UTIL_GetBotIndex (pEdict);
if ((bot_index != -1) && bots[bot_index].is_used)
// this beast is one of MY bots
Note that you can simplify all this by always filling the bots array according to their entity index (which range from 1 to 33). That is, instead of "finding a free slot in the bot's array" to stuff this bot in it during BotCreate(), ask for the entity index once the player() function has been called, and it will give you directly the right slot index in the bots array in which to put your bot. You can then get rid of UTIL_GetBotIndex() and the likes, and replace them all with ENTINDEX (pEdict) - 1.
I have RACC and POD-bot running at the same time, so I don't think the problem is in the POD-bot code. See where I'm looking at ?
