Skip to content

Commit

Permalink
fix snowman weapon ammo
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedgefog committed Dec 18, 2022
1 parent f723246 commit 1c617c5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/scripts/weapons/sw_weapon_snowman.sma
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#define VERSION SW_VERSION
#define AUTHOR "Hedgehog Fog"

#define AMMO_INDEX 4
#define DEPLOY_HEIGHT_STEP 32.0
#define DEPLOY_DISTANCE 64.0

Expand All @@ -37,7 +36,7 @@ public plugin_precache() {
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);

g_iCwHandler = CW_Register(SW_WEAPON_SNOWMAN, CSW_M249, _, AMMO_INDEX, _, _, _, 3, 2, _, "skull", CWF_NoBulletSmoke);
g_iCwHandler = CW_Register(SW_WEAPON_SNOWMAN, CSW_M249, 1, _, _, _, _, 3, 2, _, "skull", CWF_NoBulletSmoke);
CW_Bind(g_iCwHandler, CWB_Idle, "@Weapon_Idle");
CW_Bind(g_iCwHandler, CWB_Deploy, "@Weapon_Deploy");
CW_Bind(g_iCwHandler, CWB_PrimaryAttack, "@Weapon_PrimaryAttack");
Expand Down Expand Up @@ -147,14 +146,14 @@ public @Weapon_PrimaryAttack(this) {
return;
}

new iAmmo = get_member(pPlayer, m_rgAmmo, AMMO_INDEX);
new iAmmo = get_member(this, m_Weapon_iClip);
if (iAmmo <= 0) {
return;
}

@Player_DeploySnowman(pPlayer);

set_member(pPlayer, m_rgAmmo, --iAmmo, AMMO_INDEX);
set_member(this, m_Weapon_iClip, --iAmmo);
set_member(this, m_Weapon_iShotsFired, ++iShotsFired);

if (iAmmo <= 0) {
Expand Down

0 comments on commit 1c617c5

Please sign in to comment.