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

Function adddynlight

source/src/worldlight.cpp:263–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263void adddynlight(physent *owner, const vec &o, int reach, int expire, int fade, uchar r, uchar g, uchar b)
264{
265 if(!dynlight) return;
266
267 dlight &d = dlights.add();
268 d.owner = owner;
269 d.o = o;
270 if(d.owner)
271 {
272 d.offset = d.o;
273 d.offset.sub(d.owner->o);
274 }
275 else d.offset = vec(0, 0, 0);
276 d.reach = reach;
277 d.fade = fade;
278 d.expire = lastmillis + expire;
279 d.r = r;
280 d.g = g;
281 d.b = b;
282
283 d.area = NULL;
284 preparedynlight(d);
285}
286
287void cleardynlights()
288{

Callers 2

splashMethod · 0.85
attackfxMethod · 0.85

Calls 3

vecClass · 0.85
preparedynlightFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected