Bug FIXED !!!
!!!8D
First , I checked the engine function , the hltv is not sent with a edict.But why in hpb_template 4 , the
Code:
else if (msg_type == message_HLTV)
botMsgFunction = BotClient_CS_HLTV;
is under the
, I changed its position to
Code:
if (msg_type == message_WeaponList)
botMsgFunction = BotClient_CS_WeaponList;
else if (msg_type == message_HLTV)
botMsgFunction = BotClient_CS_HLTV;
and the bot dll intercept the hltv message correctly , then we come to the function code itself :
Code:
void BotClient_CS_HLTV(void *p, int bot_index)
{
static int state = 0; // current state machine state
static int players = 0;
int index;
if (state == 0)
{
players = *(int *) p; // check the byte
state++;
}
else if (state == 1)
{
if (players == 0)
{
for (index = 0; index < 32; index++)
{
if (bots[index].is_used)
{
BotSpawnInit (&bots[index]);
}
}
}
state = 0;
}
}
I changed the original code to the above one , and the result ? It worked !
!!! 8D