Honor weapon .pickup return value.

For FreeCS this means CT-team wil no longer be able to pickup the bomb.
This commit is contained in:
CYBERDEViL 2022-01-03 19:12:26 +01:00
parent d3dcb3a12b
commit f6b0b5c348
1 changed files with 13 additions and 9 deletions

View File

@ -163,8 +163,8 @@ Weapons_AddItem(base_player pl, int w, int startammo)
if (!value)
return value;
} else {
/* new to our arsenal, so always return TRUE */
g_weapons[w].pickup(TRUE, startammo);
/* new to our arsenal */
if (g_weapons[w].pickup(TRUE, startammo) == TRUE) {
pl.g_items |= g_weapons[w].id;
value = TRUE;
@ -175,6 +175,10 @@ Weapons_AddItem(base_player pl, int w, int startammo)
} else {
Weapons_PickupNotify(pl, w);
}
} else {
/* cannot pickup this weapon (weapon says no) */
return FALSE;
}
}
}