X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=data%2Fqcsrc%2Fserver%2Fcl_weaponsystem.qc;fp=data%2Fqcsrc%2Fserver%2Fcl_weaponsystem.qc;h=54670679781cef5acf5f69784c9f53112fb66304;hb=7355d1b2c06def5f07a1b78df0f38616df410e94;hp=ad316595c39e61bfa60fa606e555fe6a4a0c84ec;hpb=439fb50a286836135d0dba19f3d77378c7f33048;p=voretournament%2Fvoretournament.git diff --git a/data/qcsrc/server/cl_weaponsystem.qc b/data/qcsrc/server/cl_weaponsystem.qc index ad316595..54670679 100644 --- a/data/qcsrc/server/cl_weaponsystem.qc +++ b/data/qcsrc/server/cl_weaponsystem.qc @@ -1597,6 +1597,8 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread) void W_DisplayDigitThink() { + // dprint(strcat(ftos(gun.scale), " --------\n")); + self.nextthink = time; float w_load, w_ammo; w_load = self.owner.weapon_load[self.owner.weapon]; @@ -1611,33 +1613,15 @@ void W_DisplayDigitThink() return; } - entity gun; - if(self.dmg) // exterior weapon - { - // keep the digit attached to the same bone as the gun - setattachment(self, self.owner, "bip01 r hand"); - gun = self.owner.exteriorweaponentity; - } - else // view weapon - { - // keep the digit attached to the same bone as the gun - // TODO: Does this work with self-animated weapons too? - 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"); - gun = self.owner.weaponentity; - } - // copy all properties of the weapon to the digit - self.origin = gun.origin; - self.angles = gun.angles; - self.scale = gun.scale; - self.effects = gun.effects; - self.alpha = gun.alpha; - self.colormap = gun.colormap; - self.colormod = gun.colormod; // used by the regurgitating colors - self.glowmod = gun.glowmod; + self.origin = self.weaponentity.origin; + self.angles = self.weaponentity.angles; + self.scale = self.weaponentity.scale; + self.effects = self.weaponentity.effects; + self.alpha = self.weaponentity.alpha; + self.colormap = self.weaponentity.colormap; + self.colormod = self.weaponentity.colormod; // used by the regurgitating colors + self.glowmod = self.weaponentity.glowmod; string txt; if(self.team) // weapon load display @@ -1689,11 +1673,27 @@ void W_DisplayDigitSetup(entity own, float num, float load, float exterior) digit = spawn(); digit.owner = own; digit.weapon = own.weapon; - digit.dmg = exterior; digit.team = load; digit.cnt = num; e = get_weaponinfo(digit.weapon); + if(exterior) // exterior weapon + { + // keep the digit attached to the same bone as the gun + setattachment(digit, digit.owner, "bip01 r hand"); + digit.weaponentity = digit.owner.exteriorweaponentity; + } + else // view weapon + { + // keep the digit attached to the same bone as the gun + // TODO: Does this work with self-animated weapons too? + if(gettagindex(digit.owner.weaponentity, "weapon")) + setattachment(digit, digit.owner.weaponentity, "weapon"); + else if(gettagindex(digit.owner.weaponentity, "tag_weapon")) + setattachment(digit, digit.owner.weaponentity, "tag_weapon"); + digit.weaponentity = digit.owner.weaponentity; + } + if(load) { // weapon load digit @@ -1708,15 +1708,18 @@ void W_DisplayDigitSetup(entity own, float num, float load, float exterior) digit.nextthink = time; } -void W_Display(entity own, float load_num, float ammo_num) +void W_Display(entity own) { float i; - for(i = 1; i <= load_num; i++) + entity e; + e = get_weaponinfo(own.weapon); + + for(i = 1; fexists(strcat("models/weapons/v_", e.netname, "_digit1-", ftos(i) , ".md3")); i++) { W_DisplayDigitSetup(own, i, TRUE, FALSE); // weapon load digit, view model W_DisplayDigitSetup(own, i, TRUE, TRUE); // weapon load digit, exterior model } - for(i = 1; i <= ammo_num; i++) + for(i = 1; fexists(strcat("models/weapons/v_", e.netname, "_digit2-", ftos(i) , ".md3")); i++) { W_DisplayDigitSetup(own, i, FALSE, FALSE); // ammo count digit, view model W_DisplayDigitSetup(own, i, FALSE, TRUE); // ammo count digit, exterior model