]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Unfortunately, my previous change makes it impossible to track the object count of...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 27 Oct 2011 20:52:22 +0000 (23:52 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 27 Oct 2011 20:52:22 +0000 (23:52 +0300)
defaultXonotic.cfg
qcsrc/server/mutators/sandbox.qc

index 0f6827eabfc53797d7c751b048674c66e764733f..5969527c0e63b5d993a51ea77ae596aa06a81e08 100644 (file)
@@ -543,7 +543,7 @@ seta g_balance_cloaked_alpha 0.25
 
 set g_sandbox 0 "allow players to spawn and edit objects around the map"
 set g_sandbox_info 1 "print non-critical information to the server"
-set g_sandbox_editor_maxobjects 100 "maximum number of objects a player can have at a time"
+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_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"
index f094c4d6eb4aa86e8ba0df9ab2275be40b33a768..3c2f7f42be58e38aae14ffa7bcd459f2c5dfc808 100644 (file)
@@ -1,6 +1,6 @@
+float object_count;
 .string object_clipboard;
 .entity object_attach;
-.float object_count;
 .string material;
 
 .float touch_timer;
@@ -123,15 +123,12 @@ entity sandbox_SpawnObject()
        setorigin(e, trace_endpos);
        e.angles_y = self.v_angle_y;
 
-       self.object_count += 1; // TODO: Adapt this to crypto_idfp based players!
-
+       object_count += 1;
        return e;
 }
 
 void sandbox_RemoveObject(entity e)
 {
-       self.object_count -= 1; // TODO: Adapt this to crypto_idfp based players!
-
        if(e.material)
        {
                strunzone(e.material);
@@ -144,6 +141,8 @@ void sandbox_RemoveObject(entity e)
        }
        remove(e);
        e = world;
+
+       object_count -= 1;
 }
 
 string sandbox_Storage_Save(entity e)
@@ -257,9 +256,9 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
 
                        // ---------------- COMMAND: SPAWN OBJECT ----------------
                        case "spawn_object":
-                               if(self.object_count >= autocvar_g_sandbox_editor_maxobjects)
+                               if(object_count >= autocvar_g_sandbox_editor_maxobjects)
                                {
-                                       print_to(self, strcat("WARNING: Cannot spawn any more objects. Each player may have up to ^3", ftos(autocvar_g_sandbox_editor_maxobjects), " ^7objects at a time"));
+                                       print_to(self, strcat("WARNING: Cannot spawn any more objects. Up to ^3", ftos(autocvar_g_sandbox_editor_maxobjects), " ^7objects may exist at a time"));
                                        return TRUE;
                                }
                                if(cmd_argc < 3)
@@ -322,9 +321,9 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                        print_to(self, "WARNING: No object in clipboard. You must copy an object before you can paste it");
                                        return TRUE;
                                }
-                               if(self.object_count >= autocvar_g_sandbox_editor_maxobjects)
+                               if(object_count >= autocvar_g_sandbox_editor_maxobjects)
                                {
-                                       print_to(self, strcat("WARNING: Cannot spawn any more objects. Each player may have up to ^3", ftos(autocvar_g_sandbox_editor_maxobjects), " ^7objects at a time"));
+                                       print_to(self, strcat("WARNING: Cannot spawn any more objects. Up to ^3", ftos(autocvar_g_sandbox_editor_maxobjects), " ^7objects may exist at a time"));
                                        return TRUE;
                                }