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

Function delent

source/src/world.cpp:294–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292vector<persistent_entity> deleted_ents;
293
294void delent()
295{
296 int n = closestent();
297 if(n<0) { conoutf("no more entities"); return; }
298 syncentchanges(true);
299 int t = ents[n].type;
300 conoutf("%s entity deleted", entnames[t % MAXENTTYPES]);
301
302 entity &e = ents[n];
303 if(t == SOUND) deletesoundentity(e); //stop playing sound
304 deleted_ents.add(e);
305 ents[n].type = NOTUSED;
306 addmsg(SV_EDITENT, "ri9i3", n, NOTUSED, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
307
308 switch(t)
309 {
310 case LIGHT: calclight(); break;
311 }
312 unsavededits++;
313}
314COMMAND(delent, "");
315
316void undelent(char *index)

Callers

nothing calls this directly

Calls 7

closestentFunction · 0.85
syncentchangesFunction · 0.85
deletesoundentityFunction · 0.85
addmsgFunction · 0.85
calclightFunction · 0.85
conoutfFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected