Fix some mistakes with sniper rifle.

This commit is contained in:
Night Owl 2016-12-17 16:42:28 +05:00
parent 9230dbcf1a
commit 86fb9e4624
3 changed files with 9 additions and 7 deletions

View File

@ -98,7 +98,7 @@ int CHgun::GetItemInfo( ItemInfo *p )
p->iMaxAmmo2 = -1;
p->iMaxClip = WEAPON_NOCLIP;
p->iSlot = 3;
p->iPosition = 3;
p->iPosition = 2;
p->iId = m_iId = WEAPON_HORNETGUN;
p->iFlags = ITEM_FLAG_NOAUTOSWITCHEMPTY | ITEM_FLAG_NOAUTORELOAD;
p->iWeight = HORNETGUN_WEIGHT;

View File

@ -38,10 +38,10 @@ int CSniper::GetItemInfo(ItemInfo *p)
p->iMaxAmmo1 = _357_MAX_CARRY;
p->pszAmmo2 = NULL;
p->iMaxAmmo2 = -1;
p->iMaxClip = CROSSBOW_MAX_CLIP;
p->iMaxClip = SNIPER_MAX_CLIP;
p->iFlags = 0;
p->iSlot = 2;
p->iPosition = 3;
p->iSlot = 3;
p->iPosition = 1;
p->iId = m_iId = WEAPON_SNIPER;
p->iWeight = PYTHON_WEIGHT;
@ -66,7 +66,7 @@ void CSniper::Spawn()
m_iId = WEAPON_SNIPER;
SET_MODEL(ENT(pev), "models/w_sniper.mdl");
m_iDefaultAmmo = CROSSBOW_DEFAULT_GIVE;
m_iDefaultAmmo = SNIPER_DEFAULT_GIVE;
FallInit();// get ready to fall down.
}
@ -184,7 +184,7 @@ void CSniper::Reload(void)
if (m_pPlayer->ammo_357 <= 0)
return;
int iResult = DefaultReload(CROSSBOW_MAX_CLIP, SNIPER_RELOAD, 2.0);
int iResult = DefaultReload(SNIPER_MAX_CLIP, SNIPER_RELOAD, 2.0);
if (iResult)
{
@ -236,4 +236,4 @@ class CSniperAmmoClip : public CBasePlayerAmmo
}
};
LINK_ENTITY_TO_CLASS(ammo_sniper, CSniperAmmoClip);
LINK_ENTITY_TO_CLASS(ammo_sniper, CSniperAmmoClip);

View File

@ -137,6 +137,7 @@ public:
#define SATCHEL_MAX_CLIP WEAPON_NOCLIP
#define TRIPMINE_MAX_CLIP WEAPON_NOCLIP
#define SNARK_MAX_CLIP WEAPON_NOCLIP
#define SNIPER_MAX_CLIP 3
// the default amount of ammo that comes with each gun when it spawns
#define GLOCK_DEFAULT_GIVE 17
@ -154,6 +155,7 @@ public:
#define TRIPMINE_DEFAULT_GIVE 1
#define SNARK_DEFAULT_GIVE 5
#define HIVEHAND_DEFAULT_GIVE 8
#define SNIPER_DEFAULT_GIVE 3
// The amount of ammo given to a player by an ammo item.
#define AMMO_URANIUMBOX_GIVE 20