X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhook.qc;h=609a06bbca46ce9e3c95bb7914a1693e826111f7;hb=75f257c5016b7a4bf92a2c737a81273d6b258371;hp=4971fa3aa1705a126428729db0e2804ea6a65742;hpb=e3e13a6eac82464c004af16230f1da2b92776636;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index 4971fa3aa1..889e75d267 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -4,11 +4,11 @@ .float HookSilent; .float HookRange; -void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float alpha, float drawflag, vector vieworg) +void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg) { // I want to draw a quad... // from and to are MIDPOINTS. - + vector axis, thickdir, A, B, C, D; float length_tex; @@ -24,10 +24,10 @@ void Draw_CylindricLine(vector from, vector to, float thickness, string texture, D = to - thickdir * (thickness / 2); R_BeginPolygon(texture, drawflag); - R_PolygonVertex(A, '0 0 0' + shift * '1 0 0', rgb, alpha); - R_PolygonVertex(B, '0 1 0' + shift * '1 0 0', rgb, alpha); - R_PolygonVertex(C, '0 1 0' + (shift + length_tex) * '1 0 0', rgb, alpha); - R_PolygonVertex(D, '0 0 0' + (shift + length_tex) * '1 0 0', rgb, alpha); + R_PolygonVertex(A, '0 0 0' + shift * '1 0 0', rgb, theAlpha); + R_PolygonVertex(B, '0 1 0' + shift * '1 0 0', rgb, theAlpha); + R_PolygonVertex(C, '0 1 0' + (shift + length_tex) * '1 0 0', rgb, theAlpha); + R_PolygonVertex(D, '0 0 0' + (shift + length_tex) * '1 0 0', rgb, theAlpha); R_EndPolygon(); } @@ -59,7 +59,7 @@ void Draw_GrapplingHook() if(self.teleport_time) if(time > self.teleport_time) { - sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM); // safeguard + sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM); // safeguard self.teleport_time = 0; } @@ -83,7 +83,7 @@ void Draw_GrapplingHook() break; } - if((self.owner.sv_entnum == player_localentnum - 1)) + if((self.owner.sv_entnum == player_localentnum - 1) && autocvar_chase_active <= 0) { switch(self.HookType) { @@ -129,30 +129,13 @@ void Draw_GrapplingHook() case ENT_CLIENT_HOOK: intensity = 1; offset = 0; - if(t == COLOR_TEAM1) - { - tex = "particles/hook_red"; - rgb = '1 .3 .3'; - } - else if(t == COLOR_TEAM2) - { - tex = "particles/hook_blue"; - rgb = '.3 .3 1'; - } - else if(t == COLOR_TEAM3) - { - tex = "particles/hook_yellow"; - rgb = '1 1 .3'; - } - else if(t == COLOR_TEAM4) - { - tex = "particles/hook_pink"; - rgb = '1 .3 1'; - } - else + switch(t) { - tex = "particles/hook_green"; - rgb = '.3 1 .3'; + case NUM_TEAM_1: tex = "particles/hook_red"; rgb = '1 0.3 0.3'; break; + case NUM_TEAM_2: tex = "particles/hook_blue"; rgb = '0.3 0.3 1'; break; + case NUM_TEAM_3: tex = "particles/hook_yellow"; rgb = '1 1 0.3'; break; + case NUM_TEAM_4: tex = "particles/hook_pink"; rgb = '1 0.3 1'; break; + default: tex = "particles/hook_white"; rgb = getcsqcplayercolor(self.sv_entnum); break; } break; case ENT_CLIENT_LGBEAM: @@ -215,7 +198,7 @@ void Draw_GrapplingHook() void Remove_GrapplingHook() { - sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM); + sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM); } void Ent_ReadHook(float bIsNew, float type) @@ -226,13 +209,15 @@ void Ent_ReadHook(float bIsNew, float type) sf = ReadByte(); self.HookSilent = (sf & 0x80); - self.iflags = IFLAG_VELOCITY; + self.iflags = IFLAG_VELOCITY | IFLAG_ORIGIN; InterpolateOrigin_Undo(); if(sf & 1) { - self.owner = playerslots[ReadByte() - 1]; + float myowner = ReadByte(); + self.owner = playerslots[myowner - 1]; + self.sv_entnum = myowner; switch(self.HookType) { default: @@ -275,10 +260,10 @@ void Ent_ReadHook(float bIsNew, float type) self.drawmask = MASK_NORMAL; break; case ENT_CLIENT_LGBEAM: - sound (self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTN_NORM); + sound (self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTEN_NORM); break; case ENT_CLIENT_GAUNTLET: - sound (self, CH_SHOTS_SINGLE, "weapons/gauntletbeam_fly.wav", VOL_BASE, ATTN_NORM); + sound (self, CH_SHOTS_SINGLE, "weapons/gauntletbeam_fly.wav", VOL_BASE, ATTEN_NORM); break; } }