To get the bots to move correctly in my plugin,
http://forums.bots-united.com/showthread.php?t=3366 , I used the following function;
Quote:
void CBasePlayer:: ProcessUsercmds( CUserCmd *cmds, int numcmds, int totalcmds,
int dropped_packets, bool paused )
|
To get to this you need to get the CBasePlayer pointer, which I did with the following code;
Quote:
// entity index
iBotIndex=ENTINDEX(pEdict);
// base entity
pBaseEnt = CBaseEntity::Instance(pEdict);
// get the player entity
if ( pBaseEnt && pBaseEnt->IsPlayer() )
{
pPlayerEnt = static_cast< CBasePlayer * >( pBaseEnt );
}
if (!pPlayerEnt) return false;
|
Where pEdict is the bot edict_t, pBaseEnt is a CBaseEntity pointer, and pPlayer is the CBasePlayer pointer. I can't remember which files I needed to include to get this to work, but I think it was 'cbase.h' as it links to most things.