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

Function CopySelectedRooms

editor/MainFrm.cpp:2307–2337  ·  view source on GitHub ↗

Copies the selected rooms to the scrap buffer. Returns: true if copied ok, 0 if some error

Source from the content-addressed store, hash-verified

2305
2306// Copies the selected rooms to the scrap buffer.
2307// Returns: true if copied ok, 0 if some error
2308int CopySelectedRooms() {
2309 if (N_selected_rooms == 0) {
2310 OutrageMessageBox("You must have rooms selected for this operation.");
2311 return 0;
2312 }
2313
2314 if (!Markedroomp) {
2315 OutrageMessageBox("You must have a marked room for this operation.");
2316 return 0;
2317 }
2318
2319 if (!IsRoomSelected(ROOMNUM(Markedroomp))) {
2320 OutrageMessageBox("The Marked room must be selected for this operation.");
2321 return 0;
2322 }
2323
2324 if (!((Markedroomp->faces[Markedface].portal_num == -1) ||
2325 (Markedroomp->portals[Markedroomp->faces[Markedface].portal_num].croom == -1) ||
2326 !IsRoomSelected(Markedroomp->portals[Markedroomp->faces[Markedface].portal_num].croom))) {
2327 OutrageMessageBox("The Marked room/face must be unattached for this operation.");
2328 return 0;
2329 }
2330
2331 // Get rid of old contents of scrap buffer
2332 if (Scrap)
2333 FreeGroup(Scrap);
2334
2335 Scrap = CopyGroup(N_selected_rooms, Selected_rooms, ROOMNUM(Markedroomp), Markedface);
2336
2337 return 1;
2338}
2339
2340void CMainFrame::OnEditCopy() {

Callers 2

OnEditCopyMethod · 0.85
OnEditCutMethod · 0.85

Calls 4

OutrageMessageBoxFunction · 0.85
IsRoomSelectedFunction · 0.85
FreeGroupFunction · 0.85
CopyGroupFunction · 0.85

Tested by

no test coverage detected