MCPcopy Create free account
hub / github.com/assaultcube/AC / editmapmodelslot

Function editmapmodelslot

source/src/rendermodel.cpp:197–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195COMMAND(deletemapmodelslot, "is");
196
197void 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}
221COMMAND(editmapmodelslot, "isssss");
222
223struct tempmmslot { mapmodelinfo m; vector<int> oldslot; bool used; };

Callers

nothing calls this directly

Calls 6

noteditmodeFunction · 0.85
multiplayerFunction · 0.85
floatstrFunction · 0.85
mmshortnameFunction · 0.85
resultFunction · 0.85
inrangeMethod · 0.80

Tested by

no test coverage detected