| 492 | } |
| 493 | |
| 494 | void writemapmodelattributes() |
| 495 | { |
| 496 | stream *f = openfile("config" PATHDIVS "mapmodelattributes.cfg", "w"); |
| 497 | if(f) |
| 498 | { |
| 499 | vector<mapmodelattributes *> mmas; |
| 500 | enumerate(mdlregistry, mapmodelattributes *, m, mmas.add(m)); |
| 501 | mmas.sort(mmasort); |
| 502 | f->printf("// automatically written on exit. this is cached information extracted from model configs. no point in editing it.\n// [path %s]\n", conc(mdlattrnames, MMA_NUM, true)); // memory leak, but w/e |
| 503 | loopv(mmas) |
| 504 | { |
| 505 | f->printf("\nmapmodelregister %s", mmas[i]->name); |
| 506 | loopj(MMA_NUM) f->printf(" %s", escapestring(mmas[i]->n[j])); // escapestring can handle NULL |
| 507 | } |
| 508 | f->printf("\n\n"); |
| 509 | delete f; |
| 510 | } |
| 511 | } |
| 512 | |
| 513 | void listallmapmodelattributes(char **args, int numargs) // create a list of mapmodel paths and selected attributes |
| 514 | { |