]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
Add feature to warmup_allguns which only provides weapons in the map
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index d79c07465a858e5084489a47ef995c8dd3d75638..d53fe2082309958f83602af3d5556a42285367ee 100644 (file)
@@ -170,7 +170,7 @@ void PutObserverInServer (void)
        
        if(self.alivetime)
        {
        
        if(self.alivetime)
        {
-               if(!inWarmupStage)
+               if(!warmup_stage)
                        PlayerStats_Event(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
                self.alivetime = 0;
        }
                        PlayerStats_Event(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
                self.alivetime = 0;
        }
@@ -297,7 +297,13 @@ void FixPlayermodel()
 
                n = tokenize_console(defaultmodel);
                if(n > 0)
 
                n = tokenize_console(defaultmodel);
                if(n > 0)
+               {
                        defaultmodel = argv(floor(n * self.model_randomizer));
                        defaultmodel = argv(floor(n * self.model_randomizer));
+                       // However, do NOT randomize if the player-selected model is in the list.
+                       for (i = 0; i < n; ++i)
+                               if ((argv(i) == self.playermodel && defaultskin == stof(self.playerskin)) || argv(i) == strcat(self.playermodel, ":", self.playerskin))
+                                       defaultmodel = argv(i);
+               }
 
                i = strstrofs(defaultmodel, ":", 0);
                if(i >= 0)
 
                i = strstrofs(defaultmodel, ":", 0);
                if(i >= 0)
@@ -424,7 +430,7 @@ void PutClientInServer (void)
                        self.nex_charge = autocvar_g_balance_nex_charge_start;
                }
 
                        self.nex_charge = autocvar_g_balance_nex_charge_start;
                }
 
-               if(inWarmupStage)
+               if(warmup_stage)
                {
                        self.ammo_shells = warmup_start_ammo_shells;
                        self.ammo_nails = warmup_start_ammo_nails;
                {
                        self.ammo_shells = warmup_start_ammo_shells;
                        self.ammo_nails = warmup_start_ammo_nails;
@@ -433,7 +439,11 @@ void PutClientInServer (void)
                        self.ammo_fuel = warmup_start_ammo_fuel;
                        self.health = warmup_start_health;
                        self.armorvalue = warmup_start_armorvalue;
                        self.ammo_fuel = warmup_start_ammo_fuel;
                        self.health = warmup_start_health;
                        self.armorvalue = warmup_start_armorvalue;
-                       self.weapons = warmup_start_weapons;
+                       
+                       if(g_warmup_allguns == 2)
+                               self.weapons = warmup_start_weapons;
+                       else if(g_warmup_allguns == 1)
+                               self.weapons = (warmup_start_weapons & (weaponsInMap | start_weapons));
                }
                else
                {
                }
                else
                {
@@ -593,7 +603,7 @@ void PutClientInServer (void)
                self.weaponname = "";
                self.switchingweapon = 0;
 
                self.weaponname = "";
                self.switchingweapon = 0;
 
-               if(!inWarmupStage)
+               if(!warmup_stage)
                        if(!self.alivetime)
                                self.alivetime = time;
 
                        if(!self.alivetime)
                                self.alivetime = time;
 
@@ -811,7 +821,7 @@ void KillIndicator_Think()
                if(IS_REAL_CLIENT(self.owner))
                {
                        if(self.cnt <= 10)
                if(IS_REAL_CLIENT(self.owner))
                {
                        if(self.cnt <= 10)
-                               { Send_Notification(NOTIF_ONE, self.owner, MSG_ANNCE, Announcer_PickNumber(self.cnt)); }
+                               { Send_Notification(NOTIF_ONE, self.owner, MSG_ANNCE, Announcer_PickNumber(CNT_KILL, self.cnt)); }
                }
                self.nextthink = time + 1;
                self.cnt -= 1;
                }
                self.nextthink = time + 1;
                self.cnt -= 1;
@@ -1910,7 +1920,7 @@ void ShowRespawnCountdown()
                {
                        self.respawn_countdown = number - 1;
                        if(ceil(self.respawn_time - (time + 0.5)) == number) // only say it if it is the same number even in 0.5s; to prevent overlapping sounds
                {
                        self.respawn_countdown = number - 1;
                        if(ceil(self.respawn_time - (time + 0.5)) == number) // only say it if it is the same number even in 0.5s; to prevent overlapping sounds
-                               Send_Notification(NOTIF_ONE, self, MSG_ANNCE, Announcer_PickNumber(number)); 
+                               { Send_Notification(NOTIF_ONE, self, MSG_ANNCE, Announcer_PickNumber(CNT_RESPAWN, number)); }
                }
        }
 }
                }
        }
 }
@@ -2039,7 +2049,7 @@ void PrintWelcomeMessage()
        {
                if(self.BUTTON_INFO) // BUTTON_INFO hides initial MOTD
                        self.motd_actived_time = -2; // wait until BUTTON_INFO gets released
        {
                if(self.BUTTON_INFO) // BUTTON_INFO hides initial MOTD
                        self.motd_actived_time = -2; // wait until BUTTON_INFO gets released
-               else if(self.motd_actived_time == -2 || IS_PLAYER(self) || time - self.jointime > autocvar_welcome_message_time)
+               else if(self.motd_actived_time == -2 || IS_PLAYER(self))
                {
                        // instanctly hide MOTD
                        self.motd_actived_time = 0;
                {
                        // instanctly hide MOTD
                        self.motd_actived_time = 0;
@@ -2541,7 +2551,7 @@ void PlayerPostThink (void)
                        else if(timeleft <= 10)
                        {
                                if(timeleft != self.idlekick_lasttimeleft)
                        else if(timeleft <= 10)
                        {
                                if(timeleft != self.idlekick_lasttimeleft)
-                                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, Announcer_PickNumber(timeleft));
+                                       { Send_Notification(NOTIF_ONE, self, MSG_ANNCE, Announcer_PickNumber(CNT_IDLE, timeleft)); }
                                self.idlekick_lasttimeleft = timeleft;
                        }
                }
                                self.idlekick_lasttimeleft = timeleft;
                        }
                }
@@ -2591,7 +2601,7 @@ void PlayerPostThink (void)
        //pointparticles(particleeffectnum("machinegun_impact"), self.origin + self.view_ofs + '0 0 7', '0 0 0', 1);
 
        if(self.waypointsprite_attachedforcarrier)
        //pointparticles(particleeffectnum("machinegun_impact"), self.origin + self.view_ofs + '0 0 7', '0 0 0', 1);
 
        if(self.waypointsprite_attachedforcarrier)
-               WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent));
+               WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON));
 
        playerdemo_write();
 
 
        playerdemo_write();