diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 7072e34d..8ba0434b 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -553,6 +553,7 @@ grenadeent::grenadeent (playerent *owner, int millis) bouncetype = BT_NADE; maxspeed = 30.0f; rotspeed = 6.0f; + lastcollision = 0; } void grenadeent::explode() @@ -629,7 +630,15 @@ void grenadeent::moveoutsidebbox(const vec &direction, playerent *boundingbox) void grenadeent::destroy() { explode(); } bool grenadeent::applyphysics() { return nadestate==NS_THROWED; } -void grenadeent::oncollision() { if(nadestate==NS_THROWED) playsound(S_GRENADEBOUNCE1+rnd(2), this, 0, 0); } + +void grenadeent::oncollision() +{ + if(nadestate==NS_THROWED && (!lastcollision || lastmillis-lastcollision>50)) + { + playsound(S_GRENADEBOUNCE1+rnd(2), this, 0, 0); + lastcollision = lastmillis; + } +} // grenades