| 144 | } |
| 145 | |
| 146 | void CPathPadDialog::OnPathpadAddPath() { |
| 147 | |
| 148 | int curnode; |
| 149 | char *namestr; |
| 150 | int pathnum; |
| 151 | int dup_test; |
| 152 | |
| 153 | pathnum = AllocGamePath(); |
| 154 | if (pathnum < 0) { |
| 155 | return; |
| 156 | } |
| 157 | |
| 158 | CEditLineDialog dlg("Enter path name", this); |
| 159 | int ret = dlg.DoModal(); |
| 160 | |
| 161 | if (ret == IDCANCEL) { |
| 162 | FreeGamePath(pathnum); |
| 163 | return; |
| 164 | } |
| 165 | |
| 166 | namestr = (char *)dlg.GetText(); |
| 167 | dup_test = FindGamePathName(namestr); |
| 168 | if (dup_test != -1) { |
| 169 | OutrageMessageBox("PATH NOT CREATED: A path named %s already exists.", namestr); |
| 170 | FreeGamePath(pathnum); |
| 171 | return; |
| 172 | } |
| 173 | strcpy(GamePaths[pathnum].name, namestr); |
| 174 | |
| 175 | curnode = InsertNodeIntoPath(pathnum, -1, 0); |
| 176 | if (curnode < 0) |
| 177 | return; |
| 178 | |
| 179 | D3EditState.current_path = pathnum; |
| 180 | D3EditState.current_node = curnode; |
| 181 | World_changed = 1; |
| 182 | UpdateDialog(); |
| 183 | } |
| 184 | |
| 185 | void CPathPadDialog::OnPathpadInsertNode() { |
| 186 | int curpath = D3EditState.current_path; |
nothing calls this directly
no test coverage detected