View Single Post
Re: Post your funny code comments!
Old
  (#4)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Post your funny code comments! - 08-01-2004

Code:
// should the bot pause for a while here? ( looks kind of intelligent )


Code:
else if(i_BorA == 2){ // Bot is bored, so he behaves in a social way and wants to meet teammates ;)

if(!Task.Important()){

Task.AddTask(BT_ROAMTEAM,gpGlobals->time + 60.0,0,GetRandomPlayerWO(pEdict,bot_teamnm,1,0,pEdict),0);

}

}


Code:
// Bot is bored, so why not throw a flashbang at the base ?


the original birthday code

Code:
bool MyBirthday(void){

time_t now = time(NULL);

tm *tm_now = localtime(&now);


if(tm_now->tm_mon == 6

&&tm_now->tm_mday==8){ // 8.7.

g_lAge = tm_now->tm_year - 82;

return true;

}

return false;

}


a leftover from debugging ( only for german speaking ppl )

Code:
//FakeClientCommand(pEdict,"say","muh die kuh",0);


and the best code I once forgot to comment and then it took me some time get know what it meant ( well, joebot is a nightmare, I try to make things better in joebot xp



Code:
CBitField BFNearEnemy(g_Map.m_Waypoints.m_iNumWaypoints),

BFNotNearBot(g_Map.m_Waypoints.m_iNumWaypoints),

BFVis(g_Map.m_Waypoints.m_iNumWaypoints);

CBitField::bf_iterator iter;

// look if we can see some of the nearby waypoints to the enemy

g_Map.m_Waypoints.setDistanceMask(&BFNearEnemy,1,350,p->m_VOrigin);

// dont take the waypoints which are less than 200 units away

g_Map.m_Waypoints.setDistanceMask(&BFNotNearBot,-1,200,m_pBot->m_pPlayer->getOrigin());

// take only visible waypoints from here

g_Map.m_Waypoints.setVisibleMask(&BFVis,m_pBot->m_pPlayer->m_iNearestWP);

BFNearEnemy &= BFNotNearBot; // everything that's far enough from me

BFNearEnemy &= BFVis; // everything that's near to the enemy and visible to us

long lShootAt = BFNearEnemy.getSet();

.....


Code:
m_pBot->m_pAction->attackO(1); // press the attack button for just a second

m_pBot->m_pAction->slowDownO(1,0); // stay where you are ! ( for a second at least )


maybe I find really funny stuff tomorrow, gotta write a test tomorrow, so I guess it's better to sleep now



Last edited by @$3.1415rin; 08-01-2004 at 22:27..
  
Reply With Quote