* Updated to ZDoom 4204:

- Added Weapon.MinSelectionAmmo1 and Weapon.MinSelectionAmmo2 to exclude weapons from autoselection even if they have enough ammo to be used.
- Made FName::NameManager::Inited a static member variable.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1547 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
gez 2013-03-24 10:22:19 +00:00
parent 5f8da0db96
commit 3d90aa2206
7 changed files with 33 additions and 3 deletions

View file

@ -766,6 +766,12 @@ AWeapon *APlayerPawn::BestWeapon (const PClass *ammotype)
!weap->CheckAmmo (AWeapon::PrimaryFire, false))
continue;
// Don't select if if there isn't enough ammo as determined by the weapon's author.
if (weap->MinSelAmmo1 > 0 && (weap->Ammo1 == NULL || weap->Ammo1->Amount < weap->MinSelAmmo1))
continue;
if (weap->MinSelAmmo2 > 0 && (weap->Ammo2 == NULL || weap->Ammo2->Amount < weap->MinSelAmmo2))
continue;
// This weapon is usable!
bestOrder = weap->SelectionOrder;
bestMatch = weap;