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

Function deleteentity

source/src/world.cpp:471–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469// entity commands based on entity number (for scripts, singleplayer only)
470
471void deleteentity(char *ns)
472{
473 int n = ATOI(ns);
474 EDITMP("deleteentity");
475 if(!*ns || !ents.inrange(n)) return;
476 entity &e = ents[n];
477 int t = e.type;
478 if(t == SOUND) deletesoundentity(e);
479 conoutf("deleted entity #%d (%s)", n, entnames[e.type]);
480 deleted_ents.add(e);
481 memset((void *)&e, 0, sizeof(persistent_entity));
482 e.type = NOTUSED;
483 if(t == LIGHT) calclight();
484 unsavededits++;
485}
486COMMAND(deleteentity, "s");
487
488void addentity(char *what) // type

Callers

nothing calls this directly

Calls 5

deletesoundentityFunction · 0.85
calclightFunction · 0.85
inrangeMethod · 0.80
conoutfFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected