no bullethole sounds for local player

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2021 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2008-05-17 21:01:18 +00:00
parent bd7d14b807
commit 5e9c27405e
4 changed files with 9 additions and 10 deletions
+2 -3
View File
@@ -50,7 +50,6 @@ static itemstat powerupstats[] =
{
{33, 100, 100, S_ITEMHEALTH}, //health
{50, 100, 100, S_ITEMARMOUR}, //armour
//{16, 0, 72, S_ITEMPUP} //powerup
};
enum { GUN_KNIFE = 0, GUN_PISTOL, GUN_SHOTGUN, GUN_SUBGUN, GUN_SNIPER, GUN_ASSAULT, GUN_GRENADE, GUN_AKIMBO, NUMGUNS };
@@ -237,8 +236,8 @@ struct playerstate
case I_AMMO: return ammostats[primary];
case I_GRENADE: return ammostats[GUN_GRENADE];
case I_AKIMBO: return ammostats[GUN_AKIMBO];
case I_HEALTH:
case I_ARMOUR:
case I_HEALTH: return powerupstats[0]; // FIXME: unify
case I_ARMOUR: return powerupstats[1];
default:
return *(itemstat *)0;
}
+1 -1
View File
@@ -454,7 +454,7 @@ extern void particle_trail(int type, int fade, const vec &from, const vec &to);
extern void particle_emit(int type, int *args, int basetime, int seed, vec &p);
extern void particle_fireball(int type, vec &o);
extern void addshotline(dynent *d, const vec &from, const vec &to);
extern bool addbullethole(const vec &from, const vec &to, float radius = 1, bool noisy = true);
extern bool addbullethole(dynent *d, const vec &from, const vec &to, float radius = 1, bool noisy = true);
extern bool addscorchmark(vec &o, float radius = 7);
extern void render_particles(int time, int typemask = ~0);
+2 -2
View File
@@ -590,7 +590,7 @@ VARP(bullethole, 0, 1, 1);
VARP(bulletholettl, 0, 10000, 30000);
VARP(bulletbouncesoundrad, 0, 15, 1000);
bool addbullethole(const vec &from, const vec &to, float radius, bool noisy)
bool addbullethole(dynent *d, const vec &from, const vec &to, float radius, bool noisy)
{
if(!bulletholettl || !bullethole) return false;
vec surface, ray(to);
@@ -602,7 +602,7 @@ bool addbullethole(const vec &from, const vec &to, float radius, bool noisy)
o.add(ray.mul(dist));
o.add(vec(surface).mul(0.005f));
newparticle(o, surface, bulletholettl, 7);
if(noisy && bulletbouncesound && bulletbouncesoundrad && o.dist(camera1->o) <= bulletbouncesoundrad) playsound(S_BULLETHIT, &o, SP_LOW);
if(noisy && bulletbouncesound && bulletbouncesoundrad && d!=player1 && o.dist(camera1->o) <= bulletbouncesoundrad) playsound(S_BULLETHIT, &o, SP_LOW);
return true;
}
+4 -4
View File
@@ -809,7 +809,7 @@ bool gun::attack(vec &targ)
void gun::attackfx(const vec &from, const vec &to, int millis)
{
addbullethole(from, to);
addbullethole(owner, from, to);
addshotline(owner, from, to);
particle_splash(0, 5, 250, to);
attacksound();
@@ -834,10 +834,10 @@ bool shotgun::attack(vec &targ)
void shotgun::attackfx(const vec &from, const vec &to, int millis)
{
loopi(SGRAYS) particle_splash(0, 5, 200, sg[i]);
if(addbullethole(from, to))
if(addbullethole(owner, from, to))
{
int holes = 3+rnd(5);
loopi(holes) addbullethole(from, sg[i], 0, false);
loopi(holes) addbullethole(owner, from, sg[i], 0, false);
}
attacksound();
}
@@ -857,7 +857,7 @@ sniperrifle::sniperrifle(playerent *owner) : gun(owner, GUN_SNIPER), scoped(fals
void sniperrifle::attackfx(const vec &from, const vec &to, int millis)
{
addbullethole(from, to);
addbullethole(owner, from, to);
addshotline(owner, from, to);
particle_splash(0, 50, 200, to);
particle_trail(1, 500, from, to);