View Single Post
Re: First beta release of YaPB 2
Old
  (#26)
KWo
Developer of PODBot mm
 
KWo's Avatar
 
Status: Offline
Posts: 3,425
Join Date: Apr 2004
Default Re: First beta release of YaPB 2 - 22-05-2006

Quote:
Originally Posted by Whistler
actually that has been in YaPB for about 3 years However that sometimes will result in e.g., bots kicked strangely sometimes as the cvar values are not take effect immediately so I removed that in the January 2006 release. Maybe a better method is to use the pfnCvarGetPointer() (or something like that).
Well - I didn't notice yet such problems. Splorygon registers the cvars in
C_DLLEXPORT int Meta_Attach( ... ), but yapb has it in void GameDLLInit( void ) - maybe it works different way. I'm not good with mm stuff - so You need to figure out Your-self - it both method are equal or some of them is better. In ServerActivate we execute podbot.cfg (the first map only) - so they are setuped correctly.
About that pfnCvarGetPointer - AMX X is using similar method:
Code:
cvar_t *csstats_rankbots
cvar_t init_csstats_rankbots ={"csstats_rankbots","1"}; 

CVAR_REGISTER (&init_csstats_rankbots); 
csstats_rankbots = CVAR_GET_POINTER(init_csstats_rankbots.name); 

bool ignoreBots (edict_t *pEnt, edict_t *pOther){
   rankBots = (int)csstats_rankbots->value ? true:false; // unnoficial line added by KWo to get it working
    if ( !rankBots && ( pEnt->v.flags & FL_FAKECLIENT || ( pOther && pOther->v.flags & FL_FAKECLIENT ) ) )
        return true;
    return false;
}
  
Reply With Quote