set g_spawn_furthest 0.5 "this amount of the spawns shall be far away from any players"
set g_spawn_useallspawns 0 "use all spawns, e.g. also team spawns in non-teamplay, and all spawns, even enemy spawns, in teamplay"
+set g_spawn_near_teammate 0 "if set, players prefer spawns near a team mate"
+set g_spawn_near_teammate_distance 384 "max distance to consider a spawn to be near a team mate"
// respawn delay
set g_respawn_delay 2 "number of seconds you have to wait before you can respawn again"
set g_respawn_waves 0 "respawn in waves (every n seconds), intended to decrease overwhelming base attacks"
// spawnpoint prios
#define SPAWN_PRIO_GOOD_DISTANCE 100
#define SPAWN_PRIO_RACE_PREVIOUS_SPAWN 50
+#define SPAWN_PRIO_NEAR_TEAMMATE 10
MUTATOR_ADD(mutator_rocketflying);
if(cvar("g_vampire"))
MUTATOR_ADD(mutator_vampire);
+ if(cvar("g_spawn_near_teammate"))
+ MUTATOR_ADD(mutator_spawn_near_teammate);
if(cvar("sv_allow_fullbright"))
serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
--- /dev/null
+float autocvar_g_spawn_near_teammate_distance;
+
+MUTATOR_HOOKFUNCTION(msnt_Spawn_Score) {
+ entity p;
+
+ if(!teamplay)
+ return 0;
+
+ FOR_EACH_PLAYER(p) if(p != self) if(p.team == self.team) if(!p.deadflag)
+ {
+ if(vlen(spawn_score_spot.origin - p.origin) > autocvar_g_spawn_near_teammate_distance)
+ continue;
+ if(!checkpvs(spawn_score_spot.origin, p))
+ continue;
+ /*
+ if(self == nextent(world))
+ {
+ te_explosion(p.origin);
+ print(p.netname, " should be nearby\n");
+ }
+ */
+ spawn_score_x += SPAWN_PRIO_NEAR_TEAMMATE;
+ }
+
+ return 0;
+}
+
+MUTATOR_DEFINITION(mutator_spawn_near_teammate)
+{
+ MUTATOR_HOOK(Spawn_Score, msnt_Spawn_Score, CBC_ORDER_ANY);
+
+ return 0;
+}
MUTATOR_DECLARATION(mutator_dodging);
MUTATOR_DECLARATION(mutator_rocketflying);
MUTATOR_DECLARATION(mutator_vampire);
+
+MUTATOR_DECLARATION(mutator_spawn_near_teammate);
mutators/mutator_dodging.qc
mutators/mutator_rocketflying.qc
mutators/mutator_vampire.qc
+mutators/mutator_spawn_near_teammate.qc
../warpzonelib/anglestransform.qc
../warpzonelib/mathlib.qc