sfx = &known_sfx[num_sfx++];
memset(sfx, 0, sizeof(*sfx));
- strncpy(sfx->name, name, sizeof(sfx->name));
+ strlcpy (sfx->name, name, sizeof (sfx->name));
return sfx;
}
continue;
// don't override looped sounds
- if (ch->forceloop || (ch->sfx != NULL && ch->sfx->loopstart >= 0))
+ if ((ch->flags & CHANNELFLAG_FORCELOOP) != 0 ||
+ (ch->sfx != NULL && ch->sfx->loopstart >= 0))
continue;
if (ch->end - paintedtime < life_left)
}
target_chan->sfx = sfx;
+ target_chan->flags = CHANNELFLAG_NONE;
target_chan->pos = 0.0;
target_chan->end = paintedtime + sfx->total_length;
target_chan->lastptime = paintedtime;
ss = &channels[total_channels++];
memset(ss, 0, sizeof(*ss));
- ss->forceloop = true;
+ ss->flags = CHANNELFLAG_FORCELOOP;
ss->sfx = sfx;
VectorCopy (origin, ss->origin);
ss->master_vol = vol;
(ambient_sfx[ambient_channel]->flags & SFXFLAG_SILENTLYMISSING))
continue;
chan = &channels[ambient_channel];
- chan->forceloop = true;
+ chan->flags |= CHANNELFLAG_FORCELOOP;
chan->sfx = ambient_sfx[ambient_channel];
vol = ambient_level.value * ambientlevels[ambient_channel];