grenade sound fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1433 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -279,11 +279,11 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
|
||||
loopk(3) from[k] = getint(p)/DMF;
|
||||
loopk(3) to[k] = getint(p)/DMF;
|
||||
playerent *s = getclient(scn);
|
||||
if(!s || gun==GUN_GRENADE) break;
|
||||
if(!s) break;
|
||||
if(gun==GUN_SHOTGUN) createrays(from, to);
|
||||
s->lastaction = lastmillis;
|
||||
s->lastattackgun = s->gunselect;
|
||||
shootv(gun, from, to, s, false, 0);
|
||||
shootv(gun, from, to, s, false, -1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+13
-4
@@ -519,6 +519,8 @@ void thrownade(playerent *d, const vec &vel, bounceent *p)
|
||||
d->thrownademillis = lastmillis;
|
||||
d->inhandnade = NULL;
|
||||
|
||||
playsound(S_GRENADETHROW);
|
||||
|
||||
if(d==player1)
|
||||
{
|
||||
updatelastaction(player1);
|
||||
@@ -547,7 +549,7 @@ bounceent *newnade(playerent *d, int millis = 0)
|
||||
|
||||
d->inhandnade = p;
|
||||
d->thrownademillis = 0;
|
||||
if(d==player1) playsoundc(S_GRENADEPULL);
|
||||
playsoundc(S_GRENADEPULL);
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -561,7 +563,7 @@ void explode_nade(bounceent *i)
|
||||
|
||||
void shootv(int gun, vec &from, vec &to, playerent *d, bool local, int nademillis) // create visual effect from a shot
|
||||
{
|
||||
if(guns[gun].sound) playsound(guns[gun].sound, d==player1 ? NULL : d);
|
||||
if(guns[gun].sound != S_NULL) playsound(guns[gun].sound, d==player1 ? NULL : d);
|
||||
switch(gun)
|
||||
{
|
||||
case GUN_KNIFE:
|
||||
@@ -592,8 +594,15 @@ void shootv(int gun, vec &from, vec &to, playerent *d, bool local, int nademilli
|
||||
{
|
||||
if(d!=player1)
|
||||
{
|
||||
bounceent *p = newnade(d, nademillis);
|
||||
thrownade(d, to, p);
|
||||
if(nademillis == -1) // activate
|
||||
{
|
||||
playsound(S_GRENADEPULL);
|
||||
}
|
||||
else if(nademillis >= 0) // throw
|
||||
{
|
||||
bounceent *p = newnade(d, nademillis);
|
||||
thrownade(d, to, p);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user