]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Set weapon hitbox back to '0 0 0' after changing its model
authorMario <mario@smbclan.net>
Sat, 20 Feb 2016 11:23:31 +0000 (21:23 +1000)
committerMario <mario@smbclan.net>
Sat, 20 Feb 2016 11:23:31 +0000 (21:23 +1000)
qcsrc/common/weapons/all.qc
qcsrc/server/weapons/weaponsystem.qc

index d531b8c3f29759f1c8a9c77e922c0199dc96c26c..6232db886e7a810c8f72b403803fb5c202563e77 100644 (file)
@@ -432,6 +432,7 @@ void CL_WeaponEntity_SetModel(entity this, string name)
 #endif
                        }
                        _setmodel(this.weaponchild, W_Model(strcat("v_", name, ".md3")));
+                       setsize(this.weaponchild, '0 0 0', '0 0 0');
                        setattachment(this.weaponchild, this, t);
                }
                else
@@ -440,6 +441,7 @@ void CL_WeaponEntity_SetModel(entity this, string name)
                        this.weaponchild = NULL;
                }
 
+               setsize(this, '0 0 0', '0 0 0');
                setorigin(this, '0 0 0');
                this.angles = '0 0 0';
                this.frame = 0;
index 4972d818f3a8db4be0c27a0076cef39d2f11f509..1637d867663333b6fef51d276e69ba532ef54e0d 100644 (file)
@@ -126,7 +126,11 @@ void CL_ExteriorWeaponentity_Think()
                this.weaponname = this.owner.weaponname;
                this.dmg = this.owner.modelindex;
                this.deadflag = this.owner.deadflag;
-               if (this.owner.weaponname != "") _setmodel(this, W_Model(strcat("v_", this.owner.weaponname, ".md3")));
+               if (this.owner.weaponname != "")
+               {
+                       _setmodel(this, W_Model(strcat("v_", this.owner.weaponname, ".md3")));
+                       setsize(this, '0 0 0', '0 0 0');
+               }
                else this.model = "";
 
                int tag_found;