Makes a copy of the current object to the clipboard object, then deletes this object Returns true on success
| 66 | // Makes a copy of the current object to the clipboard object, then deletes this object |
| 67 | // Returns true on success |
| 68 | bool ObjectCut() { |
| 69 | mprintf(0, "ObjectCut()\n"); |
| 70 | if (Cur_object_index != -1) { |
| 71 | int objnum = Cur_object_index; |
| 72 | int num_player_objects = GetNumberPlayerObjs(); |
| 73 | if ((num_player_objects == 1) && Objects[objnum].type == OBJ_PLAYER) { |
| 74 | mprintf(0, "Oops, Can't delete the only player...sorry\n"); |
| 75 | return false; |
| 76 | } |
| 77 | mprintf(0, "Attempting to cut object #%d into buffer...", objnum); |
| 78 | memcpy(&ClipBoardObject, &Objects[objnum], sizeof(object)); |
| 79 | mprintf(0, "Done!\n"); |
| 80 | ObjectInBuffer = true; |
| 81 | HObjectDelete(); |
| 82 | return true; |
| 83 | } |
| 84 | return false; |
| 85 | } |
| 86 | |
| 87 | // Makes a copy of the current object to the clipboard object |
| 88 | // Returns true on success |
no test coverage detected