Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
sv_spawn_unique.qc
Go to the documentation of this file.
1#include "sv_spawn_unique.qh"
2
4
6{
7 entity player = M_ARGV(0, entity);
8 entity spawn_spot = M_ARGV(1, entity);
9 vector spawn_score = M_ARGV(2, vector);
10
11 if(spawn_spot == player.su_last_point)
12 spawn_score.x = 0.1; // extremely low priority but still selectable
13
14 M_ARGV(2, vector) = spawn_score;
15}
16
17MUTATOR_HOOKFUNCTION(spawn_unique, PlayerSpawn)
18{
19 entity player = M_ARGV(0, entity);
20 entity spawn_spot = M_ARGV(1, entity);
21
22 player.su_last_point = spawn_spot;
23}
#define REGISTER_MUTATOR(...)
Definition base.qh:295
#define MUTATOR_HOOKFUNCTION(...)
Definition base.qh:335
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define M_ARGV(x, type)
Definition events.qh:17
ERASEABLE bool expr_evaluate(string s)
Evaluate an expression of the form: [+ | -]?
Definition cvar.qh:48
vector
Definition self.qh:92
vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck, bool targetcheck)
string autocvar_g_spawn_unique