Weapons_AddItem: Don't assign bitflag to inventory if pickup() returns 0
This commit is contained in:
parent
075033e93c
commit
9c4487b2e9
|
@ -158,11 +158,18 @@ Weapons_AddItem(base_player pl, int w, int startammo)
|
|||
/* call pickup to handle the ammo */
|
||||
if (pl.g_items & g_weapons[w].id) {
|
||||
value = g_weapons[w].pickup(FALSE, startammo);
|
||||
|
||||
if (!value)
|
||||
return value;
|
||||
} else {
|
||||
/* new to our arsenal */
|
||||
pl.g_items |= g_weapons[w].id;
|
||||
value = g_weapons[w].pickup(TRUE, startammo);
|
||||
|
||||
if (!value)
|
||||
return value;
|
||||
|
||||
pl.g_items |= g_weapons[w].id;
|
||||
|
||||
/* it's new, so autoswitch? */
|
||||
if (pl.activeweapon == 0 && autocvar_sv_forceweapondraw == 1) {
|
||||
pl.activeweapon = w;
|
||||
|
|
Loading…
Reference in New Issue