]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
New functionality for g_sandbox_editor_free. 0 = players can only copy or edit their...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 29 Oct 2011 11:05:55 +0000 (14:05 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 29 Oct 2011 11:05:55 +0000 (14:05 +0300)
defaultXonotic.cfg
qcsrc/server/mutators/sandbox.qc

index f7b33003cc55c6f064f43fd062feb84eb9b0eb6f..b3a5f54de020441a24baec32d04205fe924e15f3 100644 (file)
@@ -550,7 +550,7 @@ set g_sandbox_storage_name default "name of the selected storage to use"
 set g_sandbox_storage_autosave 5 "storage is automatically saved every specified number of seconds"
 set g_sandbox_storage_autoload 1 "if a storage file exists for the given map, automatically load it at startup"
 set g_sandbox_editor_maxobjects 1000 "maximum number of objects that may exist at a time"
-set g_sandbox_editor_free 0 "when enabled, players can edit any object on the map, not just the objects they've spawned"
+set g_sandbox_editor_free 1 "0 = players can only copy or edit their own objects, 1 = players can copy but not edit other objects, 2 = players can copy and edit all object"
 set g_sandbox_editor_distance_spawn 200 "distance at which objects spawn in front of the player"
 set g_sandbox_editor_distance_edit 350 "distance at which players can edit or remove objects they are looking at"
 set g_sandbox_object_scale_min 0.1 "minimum scale that objects can be set to"
index e68a24a20e062b24ae20b4a63fa8198f76079102..5d7dac1d3757f0983c38680a8bcf38df5835a913 100644 (file)
@@ -45,7 +45,7 @@ entity sandbox_ObjectEdit_Get(float permissions)
                return trace_ent; // don't check permissions, anyone can edit this object
        if(!trace_ent.crypto_idfp)
                return trace_ent; // the player who spawned this object did not have an UID, so anyone can edit it
-       if not(trace_ent.crypto_idfp != self.crypto_idfp && !autocvar_g_sandbox_editor_free)
+       if not(trace_ent.crypto_idfp != self.crypto_idfp && autocvar_g_sandbox_editor_free < 2)
                return trace_ent; // object does not belong to the player, and players can only edit their own objects on this server
        return world;
 }
@@ -408,7 +408,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                {
                                        case "copy":
                                                // copies customizable properties of the selected object to the clipboard
-                                               e = sandbox_ObjectEdit_Get(TRUE); // you can only copy objects you can edit, so this works
+                                               e = sandbox_ObjectEdit_Get(autocvar_g_sandbox_editor_free); // can we copy objects we can't edit?
                                                if(e != world)
                                                {
                                                        if(self.object_clipboard)