]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/cl_client.qc
Campaign mode hooks
[voretournament/voretournament.git] / data / qcsrc / server / cl_client.qc
index 1905968ddc467ed8447371268ab15443291589c5..d6898c8d7859e33099f9a1f077b18054fecdaab2 100644 (file)
@@ -13,10 +13,13 @@ void Announce(string snd) {
 }\r
 \r
 void AnnounceTo(entity e, string snd) {\r
-       msg_entity = e;\r
-       WriteByte(MSG_ONE, SVC_TEMPENTITY);\r
-       WriteByte(MSG_ONE, TE_CSQC_ANNOUNCE);\r
-       WriteString(MSG_ONE, snd);\r
+       if (clienttype(e) == CLIENTTYPE_REAL)\r
+       {\r
+               msg_entity = e;\r
+               WriteByte(MSG_ONE, SVC_TEMPENTITY);\r
+               WriteByte(MSG_ONE, TE_CSQC_ANNOUNCE);\r
+               WriteString(MSG_ONE, snd);\r
+       }\r
 }\r
 \r
 float ClientData_Send(entity to, float sf)\r
@@ -466,6 +469,7 @@ void Client_uncustomizeentityforclient()
 float Client_customizeentityforclient()\r
 {\r
        entity modelsource;\r
+       string applymodel;\r
 \r
        if(self.modelindex == 0)\r
                return TRUE;\r
@@ -520,8 +524,8 @@ float Client_customizeentityforclient()
                other = other.enemy; // also do this for the player we are spectating\r
        if(other.predator == self)\r
        {\r
-               tokenizebyseparator(self.playermodel, ".");\r
-               Client_setmodel(strcat(argv(0), "_stomach.md3"));\r
+               applymodel = strcat(substring(self.playermodel, 0, strlen(self.playermodel) - 4), "_stomach.md3"); // 4 is the extension length\r
+               Client_setmodel(applymodel);\r
                self.alpha = other.cvar_cl_vore_stomachmodel;\r
                return TRUE;\r
        }\r
@@ -1006,11 +1010,12 @@ float ClientInit_SendEntity(entity to, float sf)
                WriteString(MSG_ENTITY, world.fog);\r
        else\r
                WriteString(MSG_ENTITY, "");\r
+       WriteCoord(MSG_ENTITY, cvar("g_campaign"));\r
        WriteByte(MSG_ENTITY, cvar("g_balance_armor_blockpercent") * 255.0);\r
        WriteByte(MSG_ENTITY, cvar("g_balance_weaponswitchdelay") * 255.0);\r
 \r
+       WriteCoord(MSG_ENTITY, cvar("g_vore"));\r
        WriteCoord(MSG_ENTITY, cvar("g_balance_vore_swallow_limit"));\r
-       WriteCoord(MSG_ENTITY, cvar("g_vore_showpreyhealth"));\r
        return TRUE;\r
 }\r
 \r
@@ -1636,7 +1641,8 @@ void TeamBubbleThink()
                self.model = "";\r
        else\r
        {\r
-               if(cvar("g_balance_vore_teamheal") && self.owner.health < cvar("g_balance_vore_teamheal_stable"))\r
+               if(cvar("g_balance_vore_teamheal") && cvar("g_vore_teamvore"))\r
+               if(self.owner.health < cvar("g_balance_vore_teamheal_stable"))\r
                        setmodel(self, "models/misc/teambubbleheal.spr"); // indicate that this player can be teamhealed\r
                else\r
                        setmodel(self, "models/misc/teambubble.spr");\r