diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-22 11:11:03 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-22 11:11:03 +0000 |
| commit | 8ba45dfd66c64dd73d2a6aa3c2b73796ce01286f (patch) | |
| tree | f659f504db3e1802c6d760321ec943b3ac28da26 /src/game | |
| parent | 2d26c93f052d6fc550c36239753e9e040601314f (diff) | |
| download | zcatch-8ba45dfd66c64dd73d2a6aa3c2b73796ce01286f.tar.gz zcatch-8ba45dfd66c64dd73d2a6aa3c2b73796ce01286f.zip | |
added fullauto to grenade, shotgun and rifle
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/server/gs_server.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/game/server/gs_server.cpp b/src/game/server/gs_server.cpp index 6218ef5c..845d43af 100644 --- a/src/game/server/gs_server.cpp +++ b/src/game/server/gs_server.cpp @@ -984,11 +984,15 @@ void player::fire_weapon() vec2 direction = normalize(vec2(latest_input.target_x, latest_input.target_y)); bool fullauto = false; - if(active_weapon == WEAPON_GRENADE || active_weapon == WEAPON_SHOTGUN) + if(active_weapon == WEAPON_GRENADE || active_weapon == WEAPON_SHOTGUN || active_weapon == WEAPON_RIFLE) fullauto = true; - //if(count_input(latest_previnput.fire, latest_input.fire).presses) || ((fullauto && latest_input.fire&1) && weapons[active_weapon].ammo)) - if(!count_input(latest_previnput.fire, latest_input.fire).presses) + + // check if we gonna fire + bool will_fire = false; + if(count_input(latest_previnput.fire, latest_input.fire).presses) will_fire = true; + if(fullauto && (latest_input.fire&1) && weapons[active_weapon].ammo) will_fire = true; + if(!will_fire) return; // check for ammo |