| 195 | COMMAND(deletemapmodelslot, "is"); |
| 196 | |
| 197 | void editmapmodelslot(int *n, char *rad, char *h, char *zoff, char *scale, char *name) // edit slot parameters != "" |
| 198 | { |
| 199 | string res = ""; |
| 200 | if(mapmodels.inrange(*n)) |
| 201 | { |
| 202 | mapmodelinfo &mmi = mapmodels[*n]; |
| 203 | if((*rad || *h || *zoff || *scale || *name) && !noteditmode("editmapmodelslot") && !multiplayer("editmapmodelslot")) |
| 204 | { // change attributes |
| 205 | if(*rad) mmi.rad = strtol(rad, NULL, 0); |
| 206 | if(*h) mmi.h = strtol(h, NULL, 0); |
| 207 | if(*zoff) mmi.zoff = strtol(zoff, NULL, 0); |
| 208 | float s = atof(scale); |
| 209 | if(s < 0.25f || s > 4.0f) s = 1.0f; |
| 210 | if(*scale) mmi.scale = s; |
| 211 | mmi.m = NULL; |
| 212 | if(*name) formatstring(mmi.name)("%s%s", mmpath, name); |
| 213 | unsavededits++; |
| 214 | mapmodelchanged = 1; |
| 215 | hdr.flags |= MHF_AUTOMAPCONFIG; // requires automapcfg |
| 216 | } |
| 217 | formatstring(res)("%d %d %d %s \"%s\"", mmi.rad, mmi.h, mmi.zoff, floatstr(mmi.scale, true), mmshortname(mmi.name)); // give back all current attributes |
| 218 | } |
| 219 | result(res); |
| 220 | } |
| 221 | COMMAND(editmapmodelslot, "isssss"); |
| 222 | |
| 223 | struct tempmmslot { mapmodelinfo m; vector<int> oldslot; bool used; }; |
nothing calls this directly
no test coverage detected