]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow objects without a material
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 26 Oct 2011 13:44:16 +0000 (16:44 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 26 Oct 2011 13:44:16 +0000 (16:44 +0300)
qcsrc/menu/xonotic/dialog_sandboxtools.c
qcsrc/server/mutators/sandbox.qc
xonotic-credits.txt

index 301ca92d3d6c815540dc4d16f3b87134c02bacbf..f4dd6b9807864b0411c8e3d0b1aa74175c4d8675 100644 (file)
@@ -49,9 +49,9 @@ void XonoticSandboxToolsDialog_fill(entity me)
        me.TR(me);
                me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set material:"), '0 0 0', "sandbox edit_object material $menu_sandbox_edit_material", 0));
                me.TD(me, 1, 1.5, e = makeXonoticTextSlider("menu_sandbox_edit_material"));
-                       e.addValue(e, _("metal"), "0");
-                       e.addValue(e, _("stone"), "1");
-                       e.addValue(e, _("wood"), "2");
+                       e.addValue(e, _("metal"), "1");
+                       e.addValue(e, _("stone"), "2");
+                       e.addValue(e, _("wood"), "3");
                        e.configureXonoticTextSliderValues(e);
                me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Set physics:"), '0 0 0', "sandbox edit_object physics $menu_sandbox_edit_physics", 0));
                me.TD(me, 1, 0.5, e = makeXonoticRadioButton(1, "menu_sandbox_edit_physics", "0", _("Static")));
index 9c0f0e70480d49701780d46cd1c73dc1061607e9..72830d58a479a9ae6a427afb555475f68e599cdf 100644 (file)
@@ -1,9 +1,9 @@
 .string object_clipboard;
 .float material;
 
-const float MATERIAL_METAL = 0;
-const float MATERIAL_STONE = 1;
-const float MATERIAL_WOOD = 2;
+const float MATERIAL_METAL = 1;
+const float MATERIAL_STONE = 2;
+const float MATERIAL_WOOD = 3;
 
 entity sandbox_EditObject_Get()
 {
@@ -29,6 +29,9 @@ void sandbox_EditObject_Scale(entity e, float f)
 
 void sandbox_Object_Touch()
 {
+       if(!self.material)
+               return;
+
        switch(self.material)
        {
                case MATERIAL_METAL:
@@ -100,7 +103,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                print_to(self, "^3scale value ^7- changes object scale. 0.5 is half size and 2 is double size");
                                print_to(self, "^3physics value ^7- object physics, 0 = static, 1 = movable, 2 = physical");
                                print_to(self, "^3force value ^7- amount of force applied to objects that are shot");
-                               print_to(self, "^3material value ^7- sets the material of the object. Valid materials are: 0 (metal), 1 (stone), 2 (wood)");
+                               print_to(self, "^3material value ^7- sets the material of the object. Valid materials are: 1 (metal), 2 (stone), 3 (wood)");
                                print_to(self, "^7The ^1drag object ^7key can be used to grab and carry objects. Players can only grab their own objects");
                                return TRUE;
 
index 8f2ddab6c9ad842b1d5578a6b1d4c9b48abadb1e..fba2a0ab2c0670513ae2566cb3018a4278a77607 100644 (file)
@@ -38,6 +38,7 @@ mand1nga
 Merlijn Hofstra
 remaxim
 Stephan
+Independent.nu
 
 *Engine Code Additions & QA
 Rudolf "divVerent" Polzer