sound radius limitations

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3879 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2008-12-05 23:02:40 +00:00
parent 6c7bf507e5
commit 04fd93d840
5 changed files with 28 additions and 24 deletions
+2 -1
View File
@@ -20,7 +20,8 @@ location::location(int sound, const worldobjreference &r, int priority) : cfg(NU
// get sound config
cfg = &sounds[sound];
cfg->onattach();
if((r.type==worldobjreference::WR_ENTITY && cfg->maxuses >= 0 && cfg->uses >= cfg->maxuses) || cfg->muted) // check max-use limits
const float dist = camera1->o.dist(r.currentposition());
if((r.type==worldobjreference::WR_ENTITY && cfg->maxuses >= 0 && cfg->uses >= cfg->maxuses) || cfg->muted || (cfg->audibleradius && dist>cfg->audibleradius)) // check max-use limits and audible radius
{
stale = true;
return;