]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/cl_client.qc
Rename another cvar to reflect reality
[voretournament/voretournament.git] / data / qcsrc / server / cl_client.qc
index 6796402580c015e5ae9f54f7c0c0ec2eff41daeb..aeb07d95a8dcea25bc8a2453b40306937e870058 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
@@ -426,16 +429,12 @@ string setmodel_state()
        // set the proper belly model depending on how full we are\r
        string newmodel_name, newmodel_extension, applymodel;\r
 \r
-       tokenizebyseparator(self.playermodel, ".");\r
-       newmodel_name = argv(0);\r
-       newmodel_extension = argv(1);\r
+       // 4 is the extension length\r
+       newmodel_name = substring(self.playermodel, 0, strlen(self.playermodel) - 4);\r
+       newmodel_extension = substring(self.playermodel, strlen(self.playermodel) - 4, 4);\r
 \r
-       if(self.stomach_load >= 3)\r
-               applymodel = strcat(newmodel_name, "_state3.", newmodel_extension);\r
-       else if(self.stomach_load >= 2)\r
-               applymodel = strcat(newmodel_name, "_state2.", newmodel_extension);\r
-       else if(self.stomach_load >= 1)\r
-               applymodel = strcat(newmodel_name, "_state1.", newmodel_extension);\r
+       if(self.stomach_load)\r
+               applymodel = strcat(newmodel_name, "_state", ftos(floor(self.stomach_load)), newmodel_extension);\r
        else\r
                applymodel = self.playermodel;\r
 \r
@@ -470,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
@@ -524,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
@@ -1014,7 +1014,7 @@ float ClientInit_SendEntity(entity to, float sf)
        WriteByte(MSG_ENTITY, cvar("g_balance_weaponswitchdelay") * 255.0);\r
 \r
        WriteCoord(MSG_ENTITY, cvar("g_balance_vore_swallow_limit"));\r
-       WriteCoord(MSG_ENTITY, cvar("g_vore_showpreyhealth"));\r
+       WriteCoord(MSG_ENTITY, cvar("g_vore_showhealth"));\r
        return TRUE;\r
 }\r
 \r