diff --git a/source/src/entity.h b/source/src/entity.h index 659d0a36..4bd453c5 100644 --- a/source/src/entity.h +++ b/source/src/entity.h @@ -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; } diff --git a/source/src/protos.h b/source/src/protos.h index 8d1c1f1d..4db4a3a2 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -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); diff --git a/source/src/renderparticles.cpp b/source/src/renderparticles.cpp index a70107f9..6cc33cca 100644 --- a/source/src/renderparticles.cpp +++ b/source/src/renderparticles.cpp @@ -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; } diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 9d9fd54e..5cfa790f 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -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);