From: Mario Date: Sat, 20 Feb 2016 11:23:31 +0000 (+1000) Subject: Set weapon hitbox back to '0 0 0' after changing its model X-Git-Tag: xonotic-v0.8.2~1184 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d1a97798d78d4a04f19c9f94b9f4cb501ce7fa50;p=xonotic%2Fxonotic-data.pk3dir.git Set weapon hitbox back to '0 0 0' after changing its model --- diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index d531b8c3f..6232db886 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -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; diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 4972d818f..1637d8676 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -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;