]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/spawnpoints.qc
Merge branch 'TimePath/hudpanels_registry' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / spawnpoints.qc
index 177e4bc98ce1a5bb7b58beea21f6bd5e2dc1e5c3..09d914a3c86751b7f0d6bbc97e49c8277575e560 100644 (file)
@@ -9,8 +9,8 @@
 #include "../common/util.qh"
 #include "../warpzonelib/util_server.qh"
 
-float SpawnPoint_Send(entity to, int sf)
-{SELFPARAM();
+bool SpawnPoint_Send(entity this, entity to, int sf)
+{
        WriteByte(MSG_ENTITY, ENT_CLIENT_SPAWNPOINT);
 
        WriteByte(MSG_ENTITY, self.team);
@@ -21,8 +21,8 @@ float SpawnPoint_Send(entity to, int sf)
        return true;
 }
 
-float SpawnEvent_Send(entity to, int sf)
-{SELFPARAM();
+bool SpawnEvent_Send(entity this, entity to, int sf)
+{
        float send;
 
        WriteByte(MSG_ENTITY, ENT_CLIENT_SPAWNEVENT);
@@ -53,7 +53,7 @@ void spawnpoint_use()
                self.team = activator.team;
                some_spawn_has_been_used = 1;
        }
-       LOG_INFO("spawnpoint was used!\n");
+       //LOG_INFO("spawnpoint was used!\n");
 }
 
 void relocate_spawnpoint()
@@ -141,18 +141,18 @@ void relocate_spawnpoint()
        { Net_LinkEntity(self, false, 0, SpawnPoint_Send); }
 }
 
-void spawnfunc_info_player_survivor (void)
+spawnfunc(info_player_survivor)
 {
-       spawnfunc_info_player_deathmatch();
+       spawnfunc_info_player_deathmatch(this);
 }
 
-void spawnfunc_info_player_start (void)
+spawnfunc(info_player_start)
 {
-       spawnfunc_info_player_deathmatch();
+       spawnfunc_info_player_deathmatch(this);
 }
 
-void spawnfunc_info_player_deathmatch (void)
-{SELFPARAM();
+spawnfunc(info_player_deathmatch)
+{
        self.classname = "info_player_deathmatch";
        relocate_spawnpoint();
 }
@@ -160,47 +160,47 @@ void spawnfunc_info_player_deathmatch (void)
 /*QUAKED spawnfunc_info_player_team1 (1 0 0) (-16 -16 -24) (16 16 24)
 Starting point for a player in team one (Red).
 Keys: "angle" viewing angle when spawning. */
-void spawnfunc_info_player_team1()
-{SELFPARAM();
-       if(g_assault) { remove(self); return; }
+spawnfunc(info_player_team1)
+{
+       if(g_assault) { remove(this); return; }
 
-       self.team = NUM_TEAM_1; // red
-       spawnfunc_info_player_deathmatch();
+       this.team = NUM_TEAM_1; // red
+       spawnfunc_info_player_deathmatch(this);
 }
 
 
 /*QUAKED spawnfunc_info_player_team2 (1 0 0) (-16 -16 -24) (16 16 24)
 Starting point for a player in team two (Blue).
 Keys: "angle" viewing angle when spawning. */
-void spawnfunc_info_player_team2()
-{SELFPARAM();
-       if(g_assault) { remove(self); return; }
+spawnfunc(info_player_team2)
+{
+       if(g_assault) { remove(this); return; }
 
-       self.team = NUM_TEAM_2; // blue
-       spawnfunc_info_player_deathmatch();
+       this.team = NUM_TEAM_2; // blue
+       spawnfunc_info_player_deathmatch(this);
 }
 
 /*QUAKED spawnfunc_info_player_team3 (1 0 0) (-16 -16 -24) (16 16 24)
 Starting point for a player in team three (Yellow).
 Keys: "angle" viewing angle when spawning. */
-void spawnfunc_info_player_team3()
-{SELFPARAM();
-       if(g_assault) { remove(self); return; }
+spawnfunc(info_player_team3)
+{
+       if(g_assault) { remove(this); return; }
 
-       self.team = NUM_TEAM_3; // yellow
-       spawnfunc_info_player_deathmatch();
+       this.team = NUM_TEAM_3; // yellow
+       spawnfunc_info_player_deathmatch(this);
 }
 
 
 /*QUAKED spawnfunc_info_player_team4 (1 0 0) (-16 -16 -24) (16 16 24)
 Starting point for a player in team four (Purple).
 Keys: "angle" viewing angle when spawning. */
-void spawnfunc_info_player_team4()
-{SELFPARAM();
-       if(g_assault) { remove(self); return; }
+spawnfunc(info_player_team4)
+{
+       if(g_assault) { remove(this); return; }
 
-       self.team = NUM_TEAM_4; // purple
-       spawnfunc_info_player_deathmatch();
+       this.team = NUM_TEAM_4; // purple
+       spawnfunc_info_player_deathmatch(this);
 }
 
 // Returns:
@@ -258,8 +258,9 @@ vector Spawn_Score(entity spot, float mindist, float teamcheck)
                        ++found;
                        if(ent.spawn_evalfunc)
                        {
-                               spawn_score = SELFCALL(ent, ent.spawn_evalfunc(this, spot, spawn_score));
-                               SELFCALL_DONE();
+                               WITH(entity, self, ent, {
+                                       spawn_score = ent.spawn_evalfunc(this, spot, spawn_score);
+                               });
                                if(spawn_score.x < 0)
                                        return spawn_score;
                        }