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

Function editmapsoundslot

source/src/audiomanager.cpp:948–966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

946COMMAND(deletemapsoundslot, "is");
947
948void editmapsoundslot(int *n, char *name, char *maxuses) // edit slot parameters != ""
949{
950 string res = "";
951 if(mapconfigdata.mapsoundlines.inrange(*n))
952 {
953 mapsoundline &msl = mapconfigdata.mapsoundlines[*n];
954 if((*name || *maxuses) && !noteditmode("editmapsoundslot") && !multiplayer("editmapsoundslot"))
955 { // change attributes
956 if(*maxuses) msl.maxuses = strtol(maxuses, NULL, 0);
957 if(*name) copystring(msl.name, strncmp(name, mapsoundfinalpath, mapsoundfinalpath_n) ? name : name + mapsoundfinalpath_n);
958 reloadmapsoundconfig();
959 mapsoundchanged = 1;
960 unsavededits++;
961 hdr.flags |= MHF_AUTOMAPCONFIG; // requires automapcfg
962 }
963 formatstring(res)("\"%s\" %d", msl.name, msl.maxuses); // give back all current attributes
964 }
965 result(res);
966}
967COMMAND(editmapsoundslot, "iss");
968
969void getmapsoundorigin(char *fname)

Callers

nothing calls this directly

Calls 6

noteditmodeFunction · 0.85
multiplayerFunction · 0.85
copystringFunction · 0.85
reloadmapsoundconfigFunction · 0.85
resultFunction · 0.85
inrangeMethod · 0.80

Tested by

no test coverage detected