]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a new info command for printing information about attachments (object_info attach...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 30 Oct 2011 10:46:36 +0000 (12:46 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 30 Oct 2011 10:46:36 +0000 (12:46 +0200)
qcsrc/server/mutators/sandbox.qc

index d20da7443e8fcf5e659205ce8ca8fbd73281547f..46194714be5a68b46268263deec612c8bc96096d 100644 (file)
@@ -672,6 +672,21 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                                                tags = strcat(tags, "^5", gettaginfo_name, "^7, ");
                                                        print_to(self, strcat("^2SANDBOX - INFO: ^7Object mesh is ^3", e.model, "^7 at animation frame ^3", ftos(e.frame), " ^7containing the following tags: ", tags));
                                                        return TRUE;
+                                               case "attachments":
+                                                       // should show the same info as "mesh" but for attachments
+                                                       entity head;
+                                                       for(head = world; (head = find(head, classname, "object")); )
+                                                       {
+                                                               if(head.owner == e)
+                                                               {
+                                                                       ++i; // start from 1
+                                                                       gettaginfo(e, head.tag_index);
+                                                                       s = strcat(s, "^1attachment ", ftos(i), "^7 has mesh ^3", head.model, "^7 at animation frame ^3", ftos(e.frame));
+                                                                       s = strcat(s, "^7 and is attached to bone ^5", gettaginfo_name, "^7, ");
+                                                               }
+                                                       }
+                                                       print_to(self, strcat("^2SANDBOX - INFO: ^7Object contains the following ^1", ftos(i), "^7 attachment(s): ", s));
+                                                       return TRUE;
                                        }
                                }
                                print_to(self, "^1SANDBOX - WARNING: ^7No information could be found. Make sure you are facing an object");