Update Player.cpp

This commit is contained in:
Jacobo 2022-02-03 17:54:28 -05:00 committed by GitHub
parent 5607f6113b
commit aba4068c75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3506,23 +3506,6 @@ bool idPlayer::Give( const char *statname, const char *value ) {
}
} else {
bool ret = inventory.Give( this, spawnArgs, statname, value, &idealWeapon, true );
if(!idStr::Icmp( statname, "ammo_bloodstone" ) ) {
//int i = inventory.AmmoIndexForAmmoClass( statname );
//int max = inventory.MaxAmmoForAmmoClass( this, statname );
//if(hud && inventory.ammo[ i ] >= max) {
if(hud) {
//Force an update of the bloodstone ammount
int ammoRequired;
ammo_t ammo_i = inventory.AmmoIndexForWeaponClass( "weapon_bloodstone_passive", &ammoRequired );
int bloodstoneAmmo = inventory.HasAmmo( ammo_i, ammoRequired );
hud->SetStateString("player_bloodstone_ammo", va("%i", bloodstoneAmmo));
hud->HandleNamedEvent("bloodstoneReady");
//Make sure we unlock the ability to harvest
harvest_lock = false;
}
}
return ret;
#else
return inventory.Give( this, spawnArgs, statname, value, &idealWeapon, true );