From: Mario Date: Wed, 7 May 2014 18:53:16 +0000 (+1000) Subject: Player colored hooks, also show hook coming from player in 3rd person mode X-Git-Tag: xonotic-v0.8.0~217^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=dbb2bb34d4fe962a65e3019663947ac59902093a;p=xonotic%2Fxonotic-data.pk3dir.git Player colored hooks, also show hook coming from player in 3rd person mode --- diff --git a/particles/hook_green.tga b/particles/hook_green.tga deleted file mode 100644 index e01eb47e8..000000000 Binary files a/particles/hook_green.tga and /dev/null differ diff --git a/particles/hook_white.tga b/particles/hook_white.tga new file mode 100644 index 000000000..c60f07028 Binary files /dev/null and b/particles/hook_white.tga differ diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index 196730a72..889e75d26 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -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 == NUM_TEAM_1) + switch(t) { - tex = "particles/hook_red"; - rgb = '1 .3 .3'; - } - else if(t == NUM_TEAM_2) - { - tex = "particles/hook_blue"; - rgb = '.3 .3 1'; - } - else if(t == NUM_TEAM_3) - { - tex = "particles/hook_yellow"; - rgb = '1 1 .3'; - } - else if(t == NUM_TEAM_4) - { - tex = "particles/hook_pink"; - rgb = '1 .3 1'; - } - else - { - 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: @@ -232,7 +215,9 @@ void Ent_ReadHook(float bIsNew, float type) if(sf & 1) { - self.owner = playerslots[ReadByte() - 1]; + float myowner = ReadByte(); + self.owner = playerslots[myowner - 1]; + self.sv_entnum = myowner; switch(self.HookType) { default: diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index fbdbc45f3..8b674e782 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -589,6 +589,20 @@ float getplayeralpha(float pl) return 1; } +vector getcsqcplayercolor(float pl) +{ + entity e; + + e = CSQCModel_server2csqc(pl); + if(e) + { + if(e.colormap > 0) + return colormapPaletteColor(((e.colormap >= 1024) ? e.colormap : stof(getplayerkeyvalue(e.colormap - 1, "colors"))) & 0x0F, TRUE); + } + + return '1 1 1'; +} + float getplayerisdead(float pl) { entity e;