1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-26 23:20:34 -05:00

Origins: dug up weapons get full ammo

This commit is contained in:
Jbleezy
2023-10-01 22:19:19 -07:00
parent c07b0d119d
commit cabb558351
2 changed files with 41 additions and 0 deletions

View File

@ -240,4 +240,43 @@ dig_up_weapon( digger )
if ( player != digger )
digger notify( "dig_up_weapon_shared" );
}
swap_weapon( str_weapon, e_player )
{
str_current_weapon = e_player getcurrentweapon();
if ( str_weapon == "claymore_zm" )
{
if ( !e_player hasweapon( str_weapon ) )
{
e_player thread maps\mp\zombies\_zm_weap_claymore::show_claymore_hint( "claymore_purchased" );
e_player thread maps\mp\zombies\_zm_weap_claymore::claymore_setup();
e_player thread maps\mp\zombies\_zm_audio::create_and_play_dialog( "weapon_pickup", "grenade" );
}
else
e_player givemaxammo( str_weapon );
return;
}
if ( is_player_valid( e_player ) && !e_player.is_drinking && !is_placeable_mine( str_current_weapon ) && !is_equipment( str_current_weapon ) && level.revive_tool != str_current_weapon && "none" != str_current_weapon && !e_player hacker_active() )
{
if ( !e_player hasweapon( str_weapon ) )
e_player take_old_weapon_and_give_new( str_current_weapon, str_weapon );
else
e_player givemaxammo( str_weapon );
}
}
take_old_weapon_and_give_new( current_weapon, weapon )
{
a_weapons = self getweaponslistprimaries();
if ( isdefined( a_weapons ) && a_weapons.size >= get_player_weapon_limit( self ) )
self takeweapon( current_weapon );
self giveweapon( weapon );
self givestartammo( weapon );
self switchtoweapon( weapon );
}