MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ObjectDelete

Function ObjectDelete

editor/ObjectClipboard.cpp:105–118  ·  view source on GitHub ↗

Just deletes the current object Returns true on success

Source from the content-addressed store, hash-verified

103// Just deletes the current object
104// Returns true on success
105bool ObjectDelete() {
106 mprintf(0, "ObjectDelete()\n");
107 if (Cur_object_index != -1) {
108 int objnum = Cur_object_index;
109 int num_player_objects = GetNumberPlayerObjs();
110 if ((num_player_objects == 1) && Objects[objnum].type == OBJ_PLAYER) {
111 mprintf(0, "Oops, Can't delete the only player...sorry\n");
112 return false;
113 }
114 HObjectDelete();
115 return true;
116 }
117 return false;
118}
119
120// Pastes the object in the Clipboard to the middle of the current segment
121// Returns true on success

Callers 1

OnCommandMethod · 0.85

Calls 2

GetNumberPlayerObjsFunction · 0.85
HObjectDeleteFunction · 0.85

Tested by

no test coverage detected