From ec562e8d9048d152db043cc1fda30c2368dc9521 Mon Sep 17 00:00:00 2001 From: Lutz Date: Sun, 27 Aug 2017 15:33:59 -0500 Subject: [PATCH 1/4] - Removed redundant check to 'entity->defending' --- src/acthudweapon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/acthudweapon.cpp b/src/acthudweapon.cpp index aadc03af7..0fd763274 100644 --- a/src/acthudweapon.cpp +++ b/src/acthudweapon.cpp @@ -463,7 +463,7 @@ void actHudWeapon(Entity* my) { if ( stats[clientnum]->weapon->type == SLING || stats[clientnum]->weapon->type == SHORTBOW || stats[clientnum]->weapon->type == ARTIFACT_BOW ) { - if ( !stats[clientnum]->defending && !throwGimpTimer ) + if ( throwGimpTimer == 0 ) { // bows need to be drawn back if (!bowDrawingSoundPlaying) From 437808ff3a4a4e904b1f1b2954b6f73173cb467e Mon Sep 17 00:00:00 2001 From: Lutz Date: Sun, 27 Aug 2017 15:36:42 -0500 Subject: [PATCH 2/4] * Changed assignment of 'throwGimpTimer' to be a whole number --- src/acthudweapon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/acthudweapon.cpp b/src/acthudweapon.cpp index 0fd763274..c7892e53b 100644 --- a/src/acthudweapon.cpp +++ b/src/acthudweapon.cpp @@ -473,7 +473,7 @@ void actHudWeapon(Entity* my) bowFire = false; players[clientnum]->entity->attack(0, 0, nullptr); HUDWEAPON_MOVEX = 3; - throwGimpTimer = TICKS_PER_SECOND / 4; + throwGimpTimer = 12; } else { From 3e4a6f31d18824054015c48a06535a98adf8431e Mon Sep 17 00:00:00 2001 From: Lutz Date: Sun, 27 Aug 2017 22:03:03 -0500 Subject: [PATCH 3/4] + Nullified 'bowDrawingSound' after firing to prevent undefined behavior --- src/acthudweapon.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/acthudweapon.cpp b/src/acthudweapon.cpp index c7892e53b..4f91e8beb 100644 --- a/src/acthudweapon.cpp +++ b/src/acthudweapon.cpp @@ -471,6 +471,7 @@ void actHudWeapon(Entity* my) if (bowFire) { bowFire = false; + bowDrawingSound = nullptr; players[clientnum]->entity->attack(0, 0, nullptr); HUDWEAPON_MOVEX = 3; throwGimpTimer = 12; From 25853f1c6ba7121d865b6deb8f241d71c83a49e6 Mon Sep 17 00:00:00 2001 From: Lutz Date: Tue, 26 Sep 2017 15:36:17 -0500 Subject: [PATCH 4/4] * Fixed formatting (spaces -> tabs) --- src/acthudweapon.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/acthudweapon.cpp b/src/acthudweapon.cpp index 4f91e8beb..d56de1483 100644 --- a/src/acthudweapon.cpp +++ b/src/acthudweapon.cpp @@ -465,16 +465,16 @@ void actHudWeapon(Entity* my) { if ( throwGimpTimer == 0 ) { - // bows need to be drawn back - if (!bowDrawingSoundPlaying) + // Bows need to be drawn back + if ( !bowDrawingSoundPlaying ) { - if (bowFire) + if ( bowFire ) { bowFire = false; - bowDrawingSound = nullptr; + bowDrawingSound = nullptr; players[clientnum]->entity->attack(0, 0, nullptr); HUDWEAPON_MOVEX = 3; - throwGimpTimer = 12; + throwGimpTimer = 12; // Was TICKS_PER_SECOND / 4 } else {