MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Entities_Remove

Function Entities_Remove

src/Entity.c:539–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537/* No OnContextCreated, skin textures remade when needed */
538
539void Entities_Remove(int id) {
540 struct Entity* e = Entities.List[id];
541 if (!e) return;
542
543 Event_RaiseInt(&EntityEvents.Removed, id);
544 e->VTABLE->Despawn(e);
545 Entities.List[id] = NULL;
546
547 /* TODO: Move to EntityEvents.Removed callback instead */
548 if (id < TABLIST_MAX_NAMES && TabList_EntityLinked_Get(id)) {
549 TabList_Remove(id);
550 TabList_EntityLinked_Reset(id);
551 }
552}
553
554int Entities_GetClosest(struct Entity* src) {
555 Vec3 eyePos = Entity_GetEyePosition(src);

Callers 4

Entities_FreeFunction · 0.85
OnNewMapFunction · 0.85
AddEntityFunction · 0.85
Classic_RemoveEntityFunction · 0.85

Calls 2

Event_RaiseIntFunction · 0.85
TabList_RemoveFunction · 0.85

Tested by

no test coverage detected