MCPcopy Create free account
hub / github.com/assaultcube/AC / updatelocations

Method updatelocations

source/src/soundlocation.cpp:256–277  ·  view source on GitHub ↗

update stuff, remove stale data

Source from the content-addressed store, hash-verified

254
255// update stuff, remove stale data
256void locvector::updatelocations()
257{
258 // check if camera carrier changed
259 bool camchanged = false;
260 static physent *lastcamera = NULL;
261 if(lastcamera!=camera1)
262 {
263 if(lastcamera!=NULL) camchanged = true;
264 lastcamera = camera1;
265 }
266
267 // update all locations
268 loopv(*this)
269 {
270 location *l = buf[i];
271 if(!l) continue;
272
273 l->update();
274 if(l->stale) delete_(i--);
275 else if(camchanged) l->evaluateworldobjref(); // cam changed, evaluate world reference again
276 }
277}
278
279// force pitch across all locations
280void locvector::forcepitch(float pitch)

Callers 1

updateaudioMethod · 0.80

Calls 2

evaluateworldobjrefMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected