// =========
set g_cloaked 0 "display all players mostly invisible"
set g_balance_cloaked_alpha 0.25 "opacity of cloaked players"
+
+// ==============
+// spawn unique
+// ==============
+set g_spawn_unique 0 "players cannot spawn at the same point twice"
#include <common/mutators/mutator/running_guns/_mod.inc>
#include <common/mutators/mutator/sandbox/_mod.inc>
#include <common/mutators/mutator/spawn_near_teammate/_mod.inc>
+#include <common/mutators/mutator/spawn_unique/_mod.inc>
#include <common/mutators/mutator/stale_move_negation/_mod.inc>
#include <common/mutators/mutator/status_effects/_mod.inc>
#include <common/mutators/mutator/superspec/_mod.inc>
#include <common/mutators/mutator/running_guns/_mod.qh>
#include <common/mutators/mutator/sandbox/_mod.qh>
#include <common/mutators/mutator/spawn_near_teammate/_mod.qh>
+#include <common/mutators/mutator/spawn_unique/_mod.qh>
#include <common/mutators/mutator/stale_move_negation/_mod.qh>
#include <common/mutators/mutator/status_effects/_mod.qh>
#include <common/mutators/mutator/superspec/_mod.qh>
--- /dev/null
+// generated file; do not modify
+#ifdef SVQC
+ #include <common/mutators/mutator/spawn_unique/sv_spawn_unique.qc>
+#endif
--- /dev/null
+// generated file; do not modify
+#ifdef SVQC
+ #include <common/mutators/mutator/spawn_unique/sv_spawn_unique.qh>
+#endif
--- /dev/null
+#include "sv_spawn_unique.qh"
+
+REGISTER_MUTATOR(spawn_unique, expr_evaluate(autocvar_g_spawn_unique));
+
+MUTATOR_HOOKFUNCTION(spawn_unique, Spawn_Score)
+{
+ entity player = M_ARGV(0, entity);
+ entity spawn_spot = M_ARGV(1, entity);
+ vector spawn_score = M_ARGV(2, vector);
+
+ if(spawn_spot == player.su_last_point)
+ spawn_score.x = 0.1; // extremely low priority but still selectable
+
+ M_ARGV(2, vector) = spawn_score;
+}
+
+MUTATOR_HOOKFUNCTION(spawn_unique, PlayerSpawn)
+{
+ entity player = M_ARGV(0, entity);
+ entity spawn_spot = M_ARGV(1, entity);
+
+ player.su_last_point = spawn_spot;
+}
--- /dev/null
+#pragma once
+
+string autocvar_g_spawn_unique;
+
+.entity su_last_point;