]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/cl_client.qc
Fix remaining parts of server side code. Reloading will work properly now
[voretournament/voretournament.git] / data / qcsrc / server / cl_client.qc
index ab1658f8980d7e81d8478e4d4dd1c167c369df18..19f8d0c9fe90230925864dc2c9bbdbf94de2bfe7 100644 (file)
@@ -516,13 +516,13 @@ float Client_customizeentityforclient()
        if(other.cvar_chase_active > 0 || other.classname == "observer") // the classname check prevents a bug\r
        {\r
                Client_setmodel(setmodel_state());\r
-               if not(self.predator.classname == "player")\r
+               if not(self.predator.classname == "player" || self.fakeprey)\r
                        self.alpha = default_player_alpha;\r
                return TRUE;\r
        }\r
        if(other.spectatee_status)\r
                other = other.enemy; // also do this for the player we are spectating\r
-       if(other.predator == self)\r
+       if(other.predator == self || other.fakepredator == self)\r
        {\r
                applymodel = strcat(substring(self.playermodel, 0, strlen(self.playermodel) - 4), "_stomach.md3"); // 4 is the extension length\r
                Client_setmodel(applymodel);\r
@@ -530,7 +530,7 @@ float Client_customizeentityforclient()
                return TRUE;\r
        }\r
        Client_setmodel(setmodel_state());\r
-       if not(self.predator.classname == "player")\r
+       if not(self.predator.classname == "player" || self.fakeprey)\r
                self.alpha = default_player_alpha;\r
        return TRUE;\r
 }\r
@@ -922,6 +922,8 @@ void PutClientInServer (void)
 \r
                SetCustomizer(self, Client_customizeentityforclient, Client_uncustomizeentityforclient);\r
 \r
+               Vore_DeadPrey_Detach(self);\r
+\r
                self.model = "";\r
                FixPlayermodel();\r
 \r
@@ -990,8 +992,16 @@ void PutClientInServer (void)
 \r
                // reset fields the weapons may use\r
         for (j = WEP_FIRST; j <= WEP_LAST; ++j)\r
+               {\r
             weapon_action(j, WR_RESETPLAYER);\r
 \r
+                       // all weapons must be fully loaded when we spawn\r
+                       entity e;\r
+                       e = get_weaponinfo(j);\r
+                       if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars\r
+                               self.weapon_load[j] = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));\r
+               }\r
+\r
                oldself = self;\r
                self = spot;\r
                        activator = oldself;\r
@@ -1601,7 +1611,7 @@ void ChatBubbleThink()
                remove(self);\r
                return;\r
        }\r
-       if ((self.owner.BUTTON_CHAT && !self.owner.deadflag && self.owner.predator.classname != "player")\r
+       if ((self.owner.BUTTON_CHAT && !self.owner.deadflag && self.owner.predator.classname != "player" && self.owner.fakepredator.classname != "player")\r
 #ifdef TETRIS\r
                || self.owner.tetris_on\r
 #endif\r
@@ -1644,7 +1654,7 @@ void TeamBubbleThink()
                return;\r
        }\r
 //     setorigin(self, self.owner.origin + '0 0 15' + self.owner.maxs_z * '0 0 1');  // bandwidth hog. setattachment does this now\r
-       if (self.owner.BUTTON_CHAT || self.owner.deadflag || self.owner.killindicator || self.owner.predator.classname == "player")\r
+       if (self.owner.BUTTON_CHAT || self.owner.deadflag || self.owner.killindicator || self.owner.predator.classname == "player" || self.owner.fakepredator.classname == "player")\r
                self.model = "";\r
        else\r
        {\r
@@ -2632,8 +2642,24 @@ void PlayerPreThink (void)
        if(self.taunt_soundtime)\r
        if(time > self.taunt_soundtime)\r
        {\r
+               switch(self.taunt_soundtype)\r
+               {\r
+                       case TAUNTTYPE_DEATH:\r
+                               PlayerSound(self, playersound_taunt, CHAN_VOICE, VOICETYPE_AUTOTAUNT);\r
+                               break;\r
+                       case TAUNTTYPE_VOREPRED:\r
+                               PlayerSound(self, playersound_pred, CHAN_VOICE, VOICETYPE_AUTOTAUNT);\r
+                               break;\r
+                       case TAUNTTYPE_VOREPREY:\r
+                               PlayerSound(self, playersound_prey, CHAN_VOICE, VOICETYPE_AUTOTAUNT);\r
+                               break;\r
+                       default:\r
+                               dprint("Incorrect autotaunt type\n");\r
+                               break;\r
+               }\r
+\r
                self.taunt_soundtime = 0;\r
-               PlayerSound(self, playersound_taunt, CHAN_VOICE, VOICETYPE_AUTOTAUNT);\r
+               self.taunt_soundtype = 0;\r
        }\r
 \r
        target_voicescript_next(self);\r