| 934 | } |
| 935 | |
| 936 | void matcenkeypad::OnMatMoveViewerButton() { |
| 937 | char a_type = Matcen[m_matcen_id]->GetAttachType(); |
| 938 | int attach = Matcen[m_matcen_id]->GetAttach(); |
| 939 | vector c_pnt; |
| 940 | |
| 941 | MakeBOA(); |
| 942 | |
| 943 | if (a_type == MT_OBJECT && ObjGet(attach) && Matcen[m_matcen_id]->GetCreatePnt(&c_pnt)) { |
| 944 | ObjSetPos(Viewer_object, &c_pnt, Objects[attach].roomnum, NULL, false); |
| 945 | } else if (a_type == MT_ROOM && attach >= 0 && attach <= Highest_room_index && Rooms[attach].used && |
| 946 | Matcen[m_matcen_id]->GetCreatePnt(&c_pnt)) { |
| 947 | int roomnum; |
| 948 | |
| 949 | if (Rooms[attach].flags & RF_EXTERNAL) { |
| 950 | roomnum = GetTerrainRoomFromPos(&c_pnt); |
| 951 | } else { |
| 952 | roomnum = attach; |
| 953 | } |
| 954 | |
| 955 | ObjSetPos(Viewer_object, &c_pnt, roomnum, NULL, false); |
| 956 | Viewer_moved = 1; |
| 957 | } else { |
| 958 | OutrageMessageBox(MBOX_OK, |
| 959 | "Cannot move viewer: This Matcen is either unassigned or linked to an invalid room/object."); |
| 960 | } |
| 961 | |
| 962 | UpdateDialog(); |
| 963 | } |
| 964 | |
| 965 | void matcenkeypad::OnMatPasteObjrefButton() { |
| 966 |
nothing calls this directly
no test coverage detected