Copies the selected rooms to the scrap buffer. Returns: true if copied ok, 0 if some error
| 2305 | |
| 2306 | // Copies the selected rooms to the scrap buffer. |
| 2307 | // Returns: true if copied ok, 0 if some error |
| 2308 | int 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 | |
| 2340 | void CMainFrame::OnEditCopy() { |
no test coverage detected