mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-05-30 00:41:19 +00:00
* 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:
parent
5f8da0db96
commit
3d90aa2206
7 changed files with 33 additions and 3 deletions
|
@ -264,6 +264,7 @@ public:
|
|||
const PClass *ProjectileType; // Projectile used by primary attack
|
||||
const PClass *AltProjectileType; // Projectile used by alternate attack
|
||||
int SelectionOrder; // Lower-numbered weapons get picked first
|
||||
int MinSelAmmo1, MinSelAmmo2; // Ignore in BestWeapon() if inadequate ammo
|
||||
fixed_t MoveCombatDist; // Used by bots, but do they *really* need it?
|
||||
int ReloadCounter; // For A_CheckForReload
|
||||
int BobStyle; // [XA] Bobbing style. Defines type of bobbing (e.g. Normal, Alpha)
|
||||
|
|
|
@ -65,6 +65,10 @@ void AWeapon::Serialize (FArchive &arc)
|
|||
}
|
||||
arc << FOVScale
|
||||
<< Crosshair;
|
||||
if (SaveVersion >= 4203)
|
||||
{
|
||||
arc << MinSelAmmo1 << MinSelAmmo2;
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
|
@ -65,6 +65,7 @@ struct FName::NameManager::NameBlock
|
|||
// PRIVATE DATA DEFINITIONS ------------------------------------------------
|
||||
|
||||
FName::NameManager FName::NameData;
|
||||
bool FName::NameManager::Inited;
|
||||
|
||||
// Define the predefined names.
|
||||
static const char *PredefinedNames[] =
|
||||
|
|
|
@ -116,7 +116,7 @@ protected:
|
|||
int AddName (const char *text, unsigned int hash, unsigned int bucket);
|
||||
NameBlock *AddBlock (size_t len);
|
||||
void InitBuckets ();
|
||||
bool Inited;
|
||||
static bool Inited;
|
||||
};
|
||||
|
||||
static NameManager NameData;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
// This file was automatically generated by the
|
||||
// updaterevision tool. Do not edit by hand.
|
||||
|
||||
#define ZD_SVN_REVISION_STRING "4202"
|
||||
#define ZD_SVN_REVISION_NUMBER 4202
|
||||
#define ZD_SVN_REVISION_STRING "4204"
|
||||
#define ZD_SVN_REVISION_NUMBER 4204
|
||||
|
|
|
@ -1739,6 +1739,24 @@ DEFINE_CLASS_PROPERTY(selectionorder, I, Weapon)
|
|||
defaults->SelectionOrder = i;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
DEFINE_CLASS_PROPERTY(minselectionammo1, I, Weapon)
|
||||
{
|
||||
PROP_INT_PARM(i, 0);
|
||||
defaults->MinSelAmmo1 = i;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
DEFINE_CLASS_PROPERTY(minselectionammo2, I, Weapon)
|
||||
{
|
||||
PROP_INT_PARM(i, 0);
|
||||
defaults->MinSelAmmo2 = i;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue