grenade bounce sound flood limited
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2107 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+10
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user