From a8eb5142d57a65af615fd4df3779ba81d47569a7 Mon Sep 17 00:00:00 2001 From: Rafael Barreto Date: Thu, 8 Jul 2010 20:29:34 +0000 Subject: [PATCH] fix the continuous burst without pressing the button git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5310 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/weapon.cpp | 4 +++- source/src/weapon.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 87ff1a8a..36130927 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -1148,6 +1148,8 @@ bool assaultrifle::selectable() { return weapon::selectable() && !m_noprimary && cpistol::cpistol(playerent *owner) : gun(owner, GUN_CPISTOL), bursting(false) {} bool cpistol::selectable() { return weapon::selectable() && !m_noprimary && this == owner->primweap; } +void cpistol::onselecting() { weapon::onselecting(); bursting = false; } +void cpistol::ondeselecting() { bursting = false; } void cpistol::setburst(bool enable) { if(this == owner->weaponsel && !reloading && owner->state == CS_ALIVE) @@ -1164,7 +1166,7 @@ void setburst(bool enable) cp->setburst(enable); } -COMMAND(setburst, ARG_1INT); +COMMAND(setburst, ARG_DOWN); bool cpistol::attack(vec &targ) // modded from gun::attack // FIXME { diff --git a/source/src/weapon.h b/source/src/weapon.h index 174adc07..38406462 100644 --- a/source/src/weapon.h +++ b/source/src/weapon.h @@ -146,8 +146,10 @@ struct cpistol : gun { bool bursting; cpistol(playerent *owner); - bool attack(vec &targ); bool selectable(); + void onselecting(); + void ondeselecting(); + bool attack(vec &targ); void setburst(bool enable); };