]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator_spawn_near_teammate.qc
Rebalance monsters, add more options to the regen hook, also fix nades
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_spawn_near_teammate.qc
index 2658c449371ac90eb6c932e3e1067093f00cdf6f..c3ab07a72635271dec43b04e0a87e1982361d8a6 100644 (file)
@@ -1,3 +1,7 @@
+#include "../_all.qh"
+
+#include "mutator.qh"
+
 .entity msnt_lookat;
 
 .float msnt_timer;
@@ -31,16 +35,17 @@ MUTATOR_HOOKFUNCTION(msnt_Spawn_Score)
        if(RandomSelection_chosen_ent)
        {
                spawn_spot.msnt_lookat = RandomSelection_chosen_ent;
-               spawn_score_x += SPAWN_PRIO_NEAR_TEAMMATE_FOUND;
+               spawn_score.x += SPAWN_PRIO_NEAR_TEAMMATE_FOUND;
        }
        else if(self.team == spawn_spot.team)
-               spawn_score_x += SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM; // prefer same team, if we can't find a spawn near teammate
+               spawn_score.x += SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM; // prefer same team, if we can't find a spawn near teammate
 
        return 0;
 }
 
 MUTATOR_HOOKFUNCTION(msnt_PlayerSpawn)
 {
+       // Note: when entering this, fixangle is already set.
        if(autocvar_g_spawn_near_teammate_ignore_spawnpoint)
        {
                if(autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death)
@@ -112,7 +117,6 @@ MUTATOR_HOOKFUNCTION(msnt_PlayerSpawn)
                                                                                setorigin(self, trace_endpos);
                                                                                self.angles = team_mate.angles;
                                                                                self.angles_z = 0; // never spawn tilted even if the spot says to
-                                                                               self.fixangle = TRUE; // turn this way immediately
                                                                                team_mate.msnt_timer = time + autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay;
                                                                                return 0;
                                                                        }
@@ -130,16 +134,14 @@ MUTATOR_HOOKFUNCTION(msnt_PlayerSpawn)
                        setorigin(self, best_spot);
                        self.angles = best_mate.angles;
                        self.angles_z = 0; // never spawn tilted even if the spot says to
-                       self.fixangle = TRUE; // turn this way immediately
                        best_mate.msnt_timer = time + autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay;
                }
        }
        else if(spawn_spot.msnt_lookat)
        {
                self.angles = vectoangles(spawn_spot.msnt_lookat.origin - self.origin);
-               self.angles_x = -self.angles_x;
+               self.angles_x = -self.angles.x;
                self.angles_z = 0; // never spawn tilted even if the spot says to
-               self.fixangle = TRUE; // turn this way immediately
                /*
                sprint(self, "You should be looking at ", spawn_spot.msnt_lookat.netname, "^7.\n");
                sprint(self, "distance: ", vtos(spawn_spot.msnt_lookat.origin - self.origin), "\n");