CODE
badcode
and that seems to work. have to do more testing.
changed it again, they were in infinite loops trying to get upgrades cause it didnt have checks to see if they could upgrade
CODE
morebadcode
i put in a little doodad to make them say if they could get defensive upgrades via gBotGlobals.m_bCanUpgradeDef
and it turns out its always 0, even when theres 3 hives and several of each chamber
so now i think the problem lies here..:
CODE
else
{
if ( message_type == 0 )
{
if ( state == 0 )
{
num_loops = *(int*)p;
state ++;
read_states = 0;
gBotGlobals.m_bCanUpgradeDef = FALSE;
gBotGlobals.m_bCanUpgradeSens = FALSE;
gBotGlobals.m_bCanUpgradeMov = FALSE;
if ( gBotGlobals.IsDebugLevelOn(BOT_DEBUG_MESSAGE_LEVEL) )
BotMessage(NULL,0,"num upgrades : %d",num_loops);
}
else if ( got_loops < num_loops )
{
if ( gBotGlobals.IsDebugLevelOn(BOT_DEBUG_MESSAGE_LEVEL) )
{
//BotMessage(NULL,0,"reading upgrade info : %d...",got_loops);
BotMessage(NULL,0,"Upgrade Info : %d...",*(int*)p);
}
switch ( *(int*)p )
{
case 1:
gBotGlobals.m_bCanUpgradeDef = TRUE;
break;
case 2:
gBotGlobals.m_bCanUpgradeSens = TRUE;
break;
case 3:
gBotGlobals.m_bCanUpgradeMov = TRUE;
break;
}
// READ UPGRADE INFO
got_loops++;
}
}
and... i dont know what to do about that. i dont even know wtf it does. so you gotta come help me out mr cheese!
[edit again]
ok so i debugged it.
if ( message_type == 0 )
needs to be
if ( message_type == 128 )
and then the original get upgrade code you had works fine. gotta do more testing though.