]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master' into samual/mutator_ctf
authorSamual <samual@xonotic.org>
Wed, 6 Apr 2011 01:34:23 +0000 (21:34 -0400)
committerSamual <samual@xonotic.org>
Wed, 6 Apr 2011 01:34:23 +0000 (21:34 -0400)
1  2 
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/defs.qh

index ed2d72308e11d24788264cd3efea80a0df42ef77,a1047ea9d07595dae83fcb3fd49953b5b24062c7..a07b2330ca913c5d8a0d69bf1e7d72f642ae6d8d
@@@ -132,9 -132,9 +132,9 @@@ vector Spawn_Score(entity spot, entity 
        prio = 0;
  
        // filter out spots for the wrong team
-       if(teamcheck)
-       if(spot.team != teamcheck)
-               return '-1 0 0';
+       if(teamcheck >= 0)
+               if(spot.team != teamcheck)
+                       return '-1 0 0';
  
        if(race_spawns)
                if(spot.target == "")
@@@ -269,7 -269,7 +269,7 @@@ entity Spawn_FilterOutBadSpots(entity f
                                        spotlist = spot;
  
                                /*
-                               if(teamcheck)
+                               if(teamcheck >= 0)
                                if(spot.team != teamcheck)
                                        error("invalid spawn added");
  
  
        /*
                entity e;
-               if(teamcheck)
+               if(teamcheck >= 0)
                        for(e = spotlist; e; e = e.chain)
                        {
                                print("seen ", etos(e), "\n");
@@@ -325,10 -325,15 +325,15 @@@ entity SelectSpawnPoint (float anypoint
        if (spot)
                return spot;
  
-       teamcheck = 0;
-       if(!anypoint && have_team_spawns > 0)
-               teamcheck = self.team;
+       if(anypoint)
+               teamcheck = -1;
+       else if(have_team_spawns > 0)
+               teamcheck = self.team; // MUST be team
+       else if(have_team_spawns == 0 && have_noteam_spawns)
+               teamcheck = 0; // MUST be noteam
+       else
+               teamcheck = -1;
+               // if we get here, we either require team spawns but have none, or we require non-team spawns and have none; use any spawn then
  
        // get the list of players
        playerlist = findchain(classname, "player");
                print("spot mindistance: ", vtos(spot.spawnpoint_score), "\n");
  
                entity e;
-               if(teamcheck)
+               if(teamcheck >= 0)
                        for(e = firstspot; e; e = e.chain)
                                if(e.team != teamcheck)
                                        error("invalid spawn found");
@@@ -603,7 -608,7 +608,7 @@@ void PutObserverInServer (void
        }
  
        if(self.flagcarried)
 -              DropFlag(self.flagcarried, world, world);
 +              ctf_Handle_Drop(self); // FIXCTF
  
        if(self.ballcarried && g_nexball)
                DropBall(self.ballcarried, self.origin + self.ballcarried.origin, self.velocity);
@@@ -1800,7 -1805,7 +1805,7 @@@ void ClientDisconnect (void
        Portal_ClearAll(self);
  
        if(self.flagcarried)
 -              DropFlag(self.flagcarried, world, world);
 +              ctf_Handle_Drop(self); // FIXCTF
        if(self.ballcarried && g_nexball)
                DropBall(self.ballcarried, self.origin + self.ballcarried.origin, self.velocity);
  
@@@ -2604,7 -2609,7 +2609,7 @@@ PlayerPreThin
  Called every frame for each client before the physics are run
  =============
  */
 -void() ctf_setstatus;
 +//void() ctf_setstatus;
  void() nexball_setstatus;
  .float items_added;
  void PlayerPreThink (void)
                if (g_minstagib)
                        minstagib_ammocheck();
  
 -              if(g_ctf)
 -                      ctf_setstatus();
 +              //if(g_ctf)
 +              //      ctf_setstatus();
  
                if(g_nexball)
                        nexball_setstatus();
index 3e4d0eee3af2c304736a7b252bbd6a864b6b07fe,3426c4ce56d6782db7a94a2274d23033376eea2b..6cb150f9e155b1c83f6fa67ef0f2a91438b7b8ea
@@@ -630,13 -630,12 +630,13 @@@ void PlayerDamage (entity inflictor, en
  
                if(self.flagcarried)
                {
 +                      // FIXCTF
                        if(attacker.classname != "player" && attacker.classname != "gib")
 -                              DropFlag(self.flagcarried, self, attacker); // penalty for flag loss by suicide
 +                              ctf_Handle_Drop(self); // penalty for flag loss by suicide
                        else if(attacker.team == self.team)
 -                              DropFlag(self.flagcarried, attacker, attacker); // penalty for flag loss by suicide/teamkill
 +                              ctf_Handle_Drop(self); // penalty for flag loss by suicide/teamkill
                        else
 -                              DropFlag(self.flagcarried, world, attacker);
 +                              ctf_Handle_Drop(self);
                }
                if(self.ballcarried && g_nexball)
                        DropBall(self.ballcarried, self.origin, self.velocity);
  
                if(sv_gentle > 0 || autocvar_ekg) {
                        // remove corpse
-                       PlayerCorpseDamage (inflictor, attacker, 100.0, deathtype, hitloc, force);
+                       PlayerCorpseDamage (inflictor, attacker, autocvar_sv_gibhealth+1.0, deathtype, hitloc, force);
                }
  
                // reset fields the weapons may use just in case
diff --combined qcsrc/server/defs.qh
index d3a6ac36df2d86beabf8ba0e5d80561b1971a4fb,d7179fafebb703f9c8b2d38ebd426d25cb2a3014..8b79374267a895576fd412d3e045700969e563d7
@@@ -15,7 -15,7 +15,7 @@@ float require_spawnfunc_prefix; // if t
  
  // Globals
  
 -float ctf_score_value(string parameter);
 +float ctf_ReadScore(string parameter); // SOON WON'T BE NEEDED. // FIXCTF
  
  float g_dm, g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_ca, g_lms, g_runematch, g_race, g_nexball, g_cts, g_freezetag, g_keepaway;
  float g_cloaked, g_footsteps, g_jump_grunt, g_grappling_hook, g_midair, g_minstagib, g_pinata, g_norecoil, g_minstagib_invis_alpha, g_bloodloss;
@@@ -350,7 -350,7 +350,7 @@@ float teams_matter
  
  float startitem_failed;
  
 -void DropFlag(entity flag, entity penalty_receiver, entity attacker);
 +void ctf_Handle_Drop(entity player); // FIXCTF
  void DropBall(entity ball, vector org, vector vel);
  void DropAllRunes(entity pl);
  
@@@ -410,6 -410,7 +410,7 @@@ float TemporaryDB
  
  float some_spawn_has_been_used;
  float have_team_spawns; // 0 = no team spawns requested, -1 = team spawns requested but none found, 1 = team spawns requested and found
+ float have_noteam_spawns; // 0 = no no-team spawns, 1 = no-team spawns exist
  
  // set when showing a kill countdown
  .entity killindicator;