vec3_t source_vec;
// update sound origin if we know about the entity
- if (ch->entnum > 0 && cls.state == ca_connected && cl.entities[ch->entnum].state_current.active)
+ if (ch->entnum > 0 && cls.state == ca_connected)
{
- //Con_Printf("-- entnum %i origin %f %f %f neworigin %f %f %f\n", ch->entnum, ch->origin[0], ch->origin[1], ch->origin[2], cl.entities[ch->entnum].state_current.origin[0], cl.entities[ch->entnum].state_current.origin[1], cl.entities[ch->entnum].state_current.origin[2]);
- VectorCopy(cl.entities[ch->entnum].state_current.origin, ch->origin);
- if (cl.entities[ch->entnum].state_current.modelindex && cl.model_precache[cl.entities[ch->entnum].state_current.modelindex] && cl.model_precache[cl.entities[ch->entnum].state_current.modelindex]->soundfromcenter)
- VectorMAMAM(1.0f, ch->origin, 0.5f, cl.model_precache[cl.entities[ch->entnum].state_current.modelindex]->normalmins, 0.5f, cl.model_precache[cl.entities[ch->entnum].state_current.modelindex]->normalmaxs, ch->origin);
+ if (ch->entnum >= 32768)
+ {
+ // TODO: sounds that follow CSQC entities?
+ }
+ else if (cl.entities[ch->entnum].state_current.active)
+ {
+ //Con_Printf("-- entnum %i origin %f %f %f neworigin %f %f %f\n", ch->entnum, ch->origin[0], ch->origin[1], ch->origin[2], cl.entities[ch->entnum].state_current.origin[0], cl.entities[ch->entnum].state_current.origin[1], cl.entities[ch->entnum].state_current.origin[2]);
+ VectorCopy(cl.entities[ch->entnum].state_current.origin, ch->origin);
+ if (cl.entities[ch->entnum].state_current.modelindex && cl.model_precache[cl.entities[ch->entnum].state_current.modelindex] && cl.model_precache[cl.entities[ch->entnum].state_current.modelindex]->soundfromcenter)
+ VectorMAMAM(1.0f, ch->origin, 0.5f, cl.model_precache[cl.entities[ch->entnum].state_current.modelindex]->normalmins, 0.5f, cl.model_precache[cl.entities[ch->entnum].state_current.modelindex]->normalmaxs, ch->origin);
+ }
}
mastervol = ch->master_vol;
if (sfx->fetcher == NULL)
return -1;
- if (entnum && entnum >= cl.max_entities)
- CL_ExpandEntities(entnum);
-
// Pick a channel to play on
target_chan = SND_PickChannel(entnum, entchannel);
if (!target_chan)