allow more edit commands in multiplayer

(editentity, edittextureslot, editmapmodelslot, editmapsoundslot)

the commands are still not allowed to change anything in coop, but
information retrieval is ok
This commit is contained in:
ac-stef
2017-06-09 21:52:55 +02:00
parent fcb3481e23
commit b2890a3334
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -944,12 +944,12 @@ COMMAND(deletemapsoundslot, "is");
void editmapsoundslot(int *n, char *name, char *maxuses) // edit slot parameters != ""
{
EDITMP("editmapsoundslot");
EDIT("editmapsoundslot");
string res = "";
if(mapconfigdata.mapsoundlines.inrange(*n))
{
mapsoundline &msl = mapconfigdata.mapsoundlines[*n];
if(*name || *maxuses)
if((*name || *maxuses) && !multiplayer("editmapsoundslot"))
{ // change attributes
if(*maxuses) msl.maxuses = strtol(maxuses, NULL, 0);
if(*name) copystring(msl.name, strncmp(name, mapsoundfinalpath, mapsoundfinalpath_n) ? name : name + mapsoundfinalpath_n);
+2 -2
View File
@@ -197,11 +197,11 @@ COMMAND(deletemapmodelslot, "is");
void editmapmodelslot(int *n, char *rad, char *h, char *zoff, char *scale, char *name) // edit slot parameters != ""
{
string res = "";
EDITMP("editmapmodelslot");
EDIT("editmapmodelslot");
if(mapmodels.inrange(*n))
{
mapmodelinfo &mmi = mapmodels[*n];
if(*rad || *h || *zoff || *scale || *name)
if((*rad || *h || *zoff || *scale || *name) && !multiplayer("editmapmodelslot"))
{ // change attributes
if(*rad) mmi.rad = strtol(rad, NULL, 0);
if(*h) mmi.h = strtol(h, NULL, 0);
+2 -2
View File
@@ -1078,11 +1078,11 @@ COMMAND(deletetextureslot, "iss");
void edittextureslot(int *n, char *scale, char *name) // edit slot parameters != ""
{
string res = "";
EDITMP("edittextureslot");
EDIT("edittextureslot");
if(slots.inrange(*n))
{
Slot &s = slots[*n];
if(*scale || *name)
if((*scale || *name) && !multiplayer("edittextureslot"))
{ // change attributes
float newscale = atof(scale);
_texture(s, *scale ? &newscale : NULL, *name ? name : NULL);
+2 -2
View File
@@ -485,13 +485,13 @@ void editentity(char **args, int numargs) // index x y z a1 a2 a3 a4 ...
if(numargs > 0)
{
int n = ATOI(args[0]);
EDITMP("editentity");
EDIT("editentity");
if(!*args[0] || !ents.inrange(n)) return;
entity &e = ents[n];
bool edit = false;
for(int i = 1; i < numargs; i++) if(*args[i]) edit = true; // only arguments other than empty strings can edit anything - otherwise we're just browsing
int t = e.type < MAXENTTYPES ? e.type : NOTUSED;
if(edit)
if((edit) && !multiplayer("editentity"))
{
if(e.type == SOUND)
{ // disable sound /before/ changing it