- case 0: return (targ.health < autocvar_g_balance_health_regenstable);
- case 1: return ((targ.ammo_cells && targ.ammo_cells < g_pickup_cells_max) || (targ.ammo_plasma && targ.ammo_plasma < g_pickup_plasma_max) || (targ.ammo_rockets && targ.ammo_rockets < g_pickup_rockets_max) || (targ.ammo_nails && targ.ammo_nails < g_pickup_nails_max) || (targ.ammo_shells && targ.ammo_shells < g_pickup_shells_max));
- case 2: return (targ.armorvalue < autocvar_g_balance_armor_regenstable);
- case 3: return (targ.health > 0);
+ case 0: return (GetResource(targ, RES_HEALTH) < autocvar_g_balance_health_regenstable);
+ case 1:
+ {
+ return ((GetResource(targ, RES_CELLS) && GetResource(targ, RES_CELLS) < g_pickup_cells_max)
+ || (GetResource(targ, RES_PLASMA) && GetResource(targ, RES_PLASMA) < g_pickup_plasma_max)
+ || (GetResource(targ, RES_ROCKETS) && GetResource(targ, RES_ROCKETS) < g_pickup_rockets_max)
+ || (GetResource(targ, RES_BULLETS) && GetResource(targ, RES_BULLETS) < g_pickup_nails_max)
+ || (GetResource(targ, RES_SHELLS) && GetResource(targ, RES_SHELLS) < g_pickup_shells_max)
+ );
+ }
+ case 2: return (GetResource(targ, RES_ARMOR) < autocvar_g_balance_armor_regenstable);
+ case 3: return (GetResource(targ, RES_HEALTH) > 0);