From: MirceaKitsune Date: Thu, 17 Nov 2011 15:52:07 +0000 (+0200) Subject: Get digits to attach properly to the weapon model X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=318e1f06e27050c07c79fe3f4c925c613a090261;p=voretournament%2Fvoretournament.git Get digits to attach properly to the weapon model --- diff --git a/data/qcsrc/server/cl_weaponsystem.qc b/data/qcsrc/server/cl_weaponsystem.qc index 34c9d9fa..b7654b46 100644 --- a/data/qcsrc/server/cl_weaponsystem.qc +++ b/data/qcsrc/server/cl_weaponsystem.qc @@ -1591,42 +1591,40 @@ void W_DisplayThink() return; } self.nextthink = time; -setattachment(self, self.owner.weaponentity.weaponentity, strcat("displaydigit_", ftos(self.cnt))); - //dprint(strcat(ftos(self.cnt), " --------\n")); + + if(gettagindex(self.owner.weaponentity, "weapon")) + setattachment(self, self.owner.weaponentity, "weapon"); + else if(gettagindex(self.owner.weaponentity, "tag_weapon")) + setattachment(self, self.owner.weaponentity, "tag_weapon"); } -void W_DisplaySetup(entity own, float load_num, float load_scale, float ammo_num, float ammo_scale) +void W_DisplaySetup(entity own, float load_num, float ammo_num) { float i; for(i = 1; i <= load_num + ammo_num; i += 1) { - entity digit; + entity digit, e; digit = spawn(); - //setmodel(digit, "models/weapons/w_displaydigit.md3"); - setmodel(digit, "models/items/g_h1.md3"); digit.owner = own; - digit.weapon = own.weapon; + digit.weapon = own.switchweapon; digit.cnt = i; + digit.movetype = MOVETYPE_FOLLOW; + e = get_weaponinfo(digit.weapon); if(i <= load_num) { // weapon load digit digit.digit_type = 0; - digit.scale = load_scale; + setmodel(digit, strcat("models/weapons/v_", e.netname, "_digit1-", ftos(i) , ".md3")); } else { // ammo count digit digit.digit_type = 1; - digit.scale = ammo_scale; + setmodel(digit, strcat("models/weapons/v_", e.netname, "_digit2-", ftos(i) , ".md3")); } - digit.think = W_DisplayThink; digit.nextthink = time; - //digit.viewmodelforclient = own; - //setattachment(digit, own.weaponentity.weaponentity, ""); - - dprint(strcat(own.weaponentity.weaponentity.classname, " --------\n")); } } diff --git a/data/qcsrc/server/w_grabber.qc b/data/qcsrc/server/w_grabber.qc index 98c4a385..9e007f9f 100644 --- a/data/qcsrc/server/w_grabber.qc +++ b/data/qcsrc/server/w_grabber.qc @@ -214,7 +214,7 @@ float w_grabber(float req) weapon_setup(WEP_GRABBER); self.grabber_state &~= GRABBER_WAITING_FOR_RELEASE; self.current_ammo = ammo_fuel; - W_DisplaySetup(self, 2, 1, 3, 0.75); + W_DisplaySetup(self, 2, 3); } else if (req == WR_CHECKAMMO1) {