I want to determine health pickup condition. In bg_misc.h there’s a function ‘can item be grabbed’:
qboolean BG_CanItemBeGrabbed( const entityState_t *ent, const playerState_t *ps, int *skill, int teamNum ) {
gitem_t *item;
if ( ent->modelindex < 1 || ent->modelindex >= bg_numItems ) {
Com_Error( ERR_DROP, "BG_CanItemBeGrabbed: index out of range" );
}
item = &bg_itemlist[ent->modelindex];
switch( item->giType ) {
[...]
case IT_HEALTH:
if( ps->teamNum == PC_MEDIC ) {
float extraHP = ( atoi( CG_ConfigString( CS_M_EXTRAHP )) ) ? 1.12 : 1.0;
if( ps->stats[STAT_HEALTH] >= (int)(ps->stats[STAT_MAX_HEALTH] * extraHP) ) {
return qfalse;
}
}
else {
if( ps->stats[STAT_HEALTH] >= ps->stats[STAT_MAX_HEALTH] ) {
return qfalse;
}
}
return qtrue;
I want to auto changing multiplier of STAT_MAX_HEALTH. This function is two sides - client & server, I think. Is there another way to do this, because from bg_misc.c level compiler doesn’t recognize a lots of functions including CG_ConfigString() which gets configstring value. Thx for reply.