]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix bone selection for weapon attachments for player models in the new overkill playe...
authorRudolf Polzer <divverent@xonotic.org>
Tue, 6 Mar 2012 09:14:57 +0000 (10:14 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Tue, 6 Mar 2012 09:14:57 +0000 (10:14 +0100)
qcsrc/client/csqcmodel_hooks.qc

index 27fb70d86461ea1cee14ad79ac5fd8ee8a51afe1..2cda005ce8ea51c1602db4ca7dfa9722751f4232 100644 (file)
@@ -305,6 +305,7 @@ void CSQCModel_AutoTagIndex_Apply(void)
                        {
                                // the best part is: IT EXISTS
                                if(substring(self.model, 0, 17) == "models/weapons/v_")
+                               {
                                        if(substring(self.tag_entity.model, 0, 17) == "models/weapons/h_")
                                        {
                                                self.tag_index = gettagindex(self.tag_entity, "weapon");
@@ -318,14 +319,15 @@ void CSQCModel_AutoTagIndex_Apply(void)
                                                        dprint("h_ model lacks weapon attachment, but v_ model is attached to it\n");
                                                }
                                        }
-
-                               if(substring(self.model, 0, 17) == "models/weapons/v_")
-                                       if(substring(self.tag_entity.model, 0, 14) == "models/player/")
+                                       else
                                        {
-                                               self.tag_index = gettagindex(self.tag_entity, "tag_weapon");
+                                               self.tag_index = gettagindex(self.tag_entity, "weapon");
+                                               if(!self.tag_index)
+                                                       self.tag_index = gettagindex(self.tag_entity, "tag_weapon");
                                                if(!self.tag_index)
                                                        self.tag_index = gettagindex(self.tag_entity, "bip01 r hand");
                                        }
+                               }
 
                                if(substring(self.tag_entity.model, 0, 17) == "models/weapons/v_")
                                {