PDA

View Full Version : grenades / ammo pickup ?


Hewster
4th September 2002, 12:14
Hi,

I've made both pineapple and stick grenades
available to both teams, in a modified form.

But when players pick up an ammo pack, it
will only replenish the grenade type originally
specified for their relevant team, and I
cannot find where this is dealt with in the
code.

Any pointers would be greatly appreciated,

Cheers

Hewster

Hewster
4th September 2002, 20:22
Its ok, I've sorted it.....

g_items.c around line 398 the code was this:

if (other->client->sess.sessionTeam == TEAM_RED)
weapon = WP_GRENADE_LAUNCHER;
else
weapon = WP_GRENADE_PINEAPPLE;
if (other->client->ps.ammoclip[BG_FindClipForWeapon(weapon)] < i)
other->client->ps.ammoclip[BG_FindClipForWeapon(weapon)]++;
COM_BitSet(other->client->ps.weapons,weapon);


I changed it to this:

weapon = WP_GRENADE_LAUNCHER;
if (other->client->ps.ammoclip[BG_FindClipForWeapon(weapon)] < i)
other->client->ps.ammoclip[BG_FindClipForWeapon(weapon)]++;
COM_BitSet(other->client->ps.weapons,weapon);
weapon = WP_GRENADE_PINEAPPLE;
if (other->client->ps.ammoclip[BG_FindClipForWeapon(weapon)] < i)
other->client->ps.ammoclip[BG_FindClipForWeapon(weapon)]++;
COM_BitSet(other->client->ps.weapons,weapon);


I dont know if this is the best way of doing it, but it works :grin:


Hewster