| 110 | const char *mmshortname(const char *name) { return !strncmp(name, mmpath, strlen(mmpath)) ? name + strlen(mmpath) : name; } |
| 111 | |
| 112 | void mapmodel(int *rad, int *h, int *zoff, char *scale, char *name, char *flags) |
| 113 | { |
| 114 | if(*scale && *name) // ignore "mapmodel" commands with insufficient parameters |
| 115 | { |
| 116 | if(!_ignoreillegalpaths && !strchr(name, '/') && !strchr(name, '\\')) { flagmapconfigerror(LWW_CONFIGERR * 2); } // throw errors for unconverted mapmodels (unspecific, because not all get detected) |
| 117 | intret(mapmodels.length()); |
| 118 | mapmodelinfo &mmi = mapmodels.add(); |
| 119 | mmi.rad = *rad; |
| 120 | mmi.h = *h; |
| 121 | mmi.zoff = *zoff; |
| 122 | mmi.scale = atof(scale); |
| 123 | mmi.flags = 0; |
| 124 | if(*flags) mmi.flags = ATOI(flags); |
| 125 | if(mmi.scale < 0.25f || mmi.scale > 4.0f) |
| 126 | { |
| 127 | mmi.scale = 1.0f; |
| 128 | if(strcmp(scale, "0")) { flagmapconfigerror(LWW_CONFIGERR * 2); scripterr(); } |
| 129 | } |
| 130 | mmi.m = NULL; |
| 131 | |
| 132 | filtertext(name, name, FTXT__MEDIAFILEPATH); |
| 133 | formatstring(mmi.name)("%s%s", mmpath, name[0] == '.' && name[1] == '/' ? name + 2 : name); |
| 134 | mapmodelchanged = 1; |
| 135 | flagmapconfigchange(); |
| 136 | } |
| 137 | else { flagmapconfigerror(LWW_CONFIGERR * 2); scripterr(); } |
| 138 | } |
| 139 | COMMAND(mapmodel, "iiisss"); |
| 140 | |
| 141 | void mapmodelreset() |
nothing calls this directly
no test coverage detected