fix permissions for some edit commands

- always allow read-only edittextureslot, editmapmodelslot and
  editmapsoundslot
- allow setvantagepoint when editing offline or spectating offline
- new var editing_sp: 1 during edit mode in singleplayer (offline)
- additional menus for read-only access to map config slots
- new bonus edit scripts: selectmiddle and unclipentclippedmodels

DOCREF edittextureslot editmapmodelslot editmapsoundslot setvantagepoint
DOCREF editing_sp
This commit is contained in:
ac-stef
2017-06-14 16:33:58 +02:00
parent 9bb9cc280b
commit d7277c1aa4
8 changed files with 227 additions and 65 deletions
+2 -2
View File
@@ -1078,11 +1078,10 @@ COMMAND(deletetextureslot, "iss");
void edittextureslot(int *n, char *scale, char *name) // edit slot parameters != ""
{
string res = "";
EDIT("edittextureslot");
if(slots.inrange(*n))
{
Slot &s = slots[*n];
if((*scale || *name) && !multiplayer("edittextureslot"))
if((*scale || *name) && !noteditmode("edittextureslot") && !multiplayer("edittextureslot"))
{ // change attributes
float newscale = atof(scale);
_texture(s, *scale ? &newscale : NULL, *name ? name : NULL);
@@ -1097,6 +1096,7 @@ COMMAND(edittextureslot, "iss");
void gettextureorigin(char *fname)
{
if(!*fname) return;
defformatstring(s)("packages/textures/%s", fname);
findfile(path(s), "r");
const char *res = s;