- added a new dmflag for allowing switching to weapons without ammo.
SVN r2346 (trunk)
This commit is contained in:
parent
e848fa3c4c
commit
bdd2ebfe14
6 changed files with 17 additions and 7 deletions
|
|
@ -753,7 +753,7 @@ int FWeaponSlot::LocateWeapon(const PClass *type)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
AWeapon *FWeaponSlot::PickWeapon(player_t *player)
|
||||
AWeapon *FWeaponSlot::PickWeapon(player_t *player, bool checkammo)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
|
|
@ -777,9 +777,12 @@ AWeapon *FWeaponSlot::PickWeapon(player_t *player)
|
|||
{
|
||||
AWeapon *weap = static_cast<AWeapon *> (player->mo->FindInventory(Weapons[j].Type));
|
||||
|
||||
if (weap != NULL && weap->IsKindOf(RUNTIME_CLASS(AWeapon)) && weap->CheckAmmo(AWeapon::EitherFire, false))
|
||||
if (weap != NULL && weap->IsKindOf(RUNTIME_CLASS(AWeapon)))
|
||||
{
|
||||
return weap;
|
||||
if (!checkammo || weap->CheckAmmo(AWeapon::EitherFire, false))
|
||||
{
|
||||
return weap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -789,9 +792,12 @@ AWeapon *FWeaponSlot::PickWeapon(player_t *player)
|
|||
{
|
||||
AWeapon *weap = static_cast<AWeapon *> (player->mo->FindInventory(Weapons[i].Type));
|
||||
|
||||
if (weap != NULL && weap->IsKindOf(RUNTIME_CLASS(AWeapon)) && weap->CheckAmmo(AWeapon::EitherFire, false))
|
||||
if (weap != NULL && weap->IsKindOf(RUNTIME_CLASS(AWeapon)))
|
||||
{
|
||||
return weap;
|
||||
if (!checkammo || weap->CheckAmmo(AWeapon::EitherFire, false))
|
||||
{
|
||||
return weap;
|
||||
}
|
||||
}
|
||||
}
|
||||
return player->ReadyWeapon;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue