]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Implement an entity which can send a portrait over to the client. Currently just...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 29 Jan 2012 20:00:50 +0000 (22:00 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 29 Jan 2012 20:00:50 +0000 (22:00 +0200)
data/qcsrc/client/Main.qc
data/qcsrc/client/hud.qc
data/qcsrc/common/constants.qh
data/qcsrc/server/cl_client.qc
data/qcsrc/server/miscfunctions.qc

index d84f6ce5c801c674776d21b3fb61c7e9cc65a738..4a106a31007690603b2e9de09b776937967260dc 100644 (file)
@@ -948,6 +948,7 @@ void(float bIsNewEntity) CSQC_Ent_Update =
                case ENT_CLIENT_WARPZONE: WarpZone_Read(bIsNewEntity); break;\r
                case ENT_CLIENT_WARPZONE_CAMERA: WarpZone_Camera_Read(bIsNewEntity); break;\r
                case ENT_CLIENT_TRIGGER_MUSIC: Ent_ReadTriggerMusic(); break;\r
+               case ENT_CLIENT_PORTRAIT: Ent_ReadPortrait(); break;\r
                default:\r
                        error(strcat("unknown entity type in CSQC_Ent_Update: ", ftos(self.enttype), "\n"));\r
                        break;\r
index e0723db1625cf9db6298071587f14b920ef82d0e..936804609d2715b6f3d0afe9b4e30df0bfc04e91 100644 (file)
@@ -3550,3 +3550,11 @@ void CSQC_race_hud(void)
        }\r
        drawfont = sbar_font;\r
 }\r
+\r
+void Ent_ReadPortrait()\r
+{\r
+       string s;\r
+       s = ReadString();\r
+\r
+       dprint(strcat(s, " --------\n"));\r
+}\r
index 2825c5ea259650da5e3db838fb029c104e3f41e9..28e8584685caddf21fe1bac3273ce23f9f5d8968 100644 (file)
@@ -98,6 +98,7 @@ const float ENT_CLIENT_MODELEFFECT = 22;
 const float ENT_CLIENT_WARPZONE = 23;\r
 const float ENT_CLIENT_WARPZONE_CAMERA = 24;\r
 const float ENT_CLIENT_TRIGGER_MUSIC = 25;\r
+const float ENT_CLIENT_PORTRAIT = 26;\r
 \r
 const float ENT_CLIENT_TURRET = 40;\r
 \r
index 33406554dd2ac92b7a0780b3b54c26205b6719ee..09172abe248709dae0e106a2dbe4dc0bba78f140 100644 (file)
@@ -2478,6 +2478,8 @@ void() ctf_setstatus;
 .float power_sounded;\r
 void PlayerPreThink (void)\r
 {\r
+       portrait(self); // TEMPORARY TEST\r
+\r
        self.stat_game_starttime = game_starttime;\r
        self.stat_allow_oldnexbeam = cvar("g_allow_oldnexbeam");\r
        self.stat_leadlimit = cvar("leadlimit");\r
index caf444e8932a823bf3bd20e6f6d0f3eb356474cc..84f68f7179dcd6ed7ab95b8632f88c11027c85c6 100644 (file)
@@ -2461,6 +2461,30 @@ void modeleffect_spawn(string m, float s, float f, vector o, vector v, vector an
        Net_LinkEntity(e, FALSE, 0.1, modeleffect_SendEntity);\r
 }\r
 \r
+float portrait_SendEntity(entity to, float sf)\r
+{\r
+       WriteByte(MSG_ENTITY, ENT_CLIENT_PORTRAIT);\r
+\r
+       string s;\r
+       s = substring(self.model, 0, strlen(self.model) - 4); // remove extension\r
+       s = strcat(s, "-", ftos(self.skin));\r
+\r
+       WriteString(MSG_ENTITY, s);\r
+\r
+       return TRUE;\r
+}\r
+\r
+void portrait(entity pl)\r
+{\r
+       entity e;\r
+       e = spawn();\r
+       e.classname = "portrait";\r
+       setmodel(e, pl.model);\r
+       e.skin = pl.skin;\r
+\r
+       Net_LinkEntity(e, FALSE, 0.1, portrait_SendEntity);\r
+}\r
+\r
 void shockwave_spawn(string m, vector org, float sz, float t1, float t2)\r
 {\r
        return modeleffect_spawn(m, 0, 0, org, '0 0 0', '0 0 0', '0 0 0', 0, sz, 1, t1, t2);\r