From: unknown Date: Wed, 24 Nov 2010 02:19:28 +0000 (-0500) Subject: Add a sound for when the ball touches something, and fix precaching for sounds X-Git-Tag: xonotic-v0.1.0preview~86^2~2^2~1^2~15 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=4ea41b7baf22cf242b9ef94e50855d925c39be45 Add a sound for when the ball touches something, and fix precaching for sounds --- diff --git a/qcsrc/server/mutators/gamemode_keepaway.qc b/qcsrc/server/mutators/gamemode_keepaway.qc index 4e59487b1c..630f101d37 100644 --- a/qcsrc/server/mutators/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/gamemode_keepaway.qc @@ -11,6 +11,8 @@ void ka_Initialize() // run at the start of a match, initiates game mode precache_sound("keepaway/pickedup.wav"); precache_sound("keepaway/dropped.wav"); + precache_sound("keepaway/respawn.wav"); + precache_sound("keepaway/touch.wav"); ScoreRules_keepaway(); @@ -80,7 +82,7 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE); WaypointSprite_UpdateTeamRadar(self.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '0 1 1'); - sound(self.owner, CHAN_AUTO, "keepaway/respawn.wav", VOL_BASE, ATTN_NONE); + sound(self, CHAN_AUTO, "keepaway/respawn.wav", VOL_BASE, ATTN_NONE); } else { @@ -92,6 +94,7 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated void ka_TouchEvent() // runs any time that the ball comes in contact with something { + if(!self) { return; } if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) { self.think = ka_RespawnBall; @@ -100,11 +103,11 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth } if(other.deadflag != DEAD_NO) { return; } if(other.classname != "player") - { + { // The ball just touched an object, most likely the world pointparticles(particleeffectnum("kaball_sparks"), self.origin, '0 0 0', 1); + sound(self, CHAN_AUTO, "keepaway/touch.wav", VOL_BASE, ATTN_NORM); return; } - if(!self) { return; } if(self.wait > time) { return; } self.owner = other; diff --git a/sound/keepaway/touch.wav b/sound/keepaway/touch.wav new file mode 100644 index 0000000000..2ab908be37 Binary files /dev/null and b/sound/keepaway/touch.wav differ