7
7
typedef struct wipeout_spawn_config_t
8
8
{
9
9
vec3_t origin ; // spawn point coordinates
10
+ float angle ; // spawn point angle (yaw)
10
11
char * name ; // spawn point name (for debugging)
11
12
float custom_radius ; // custom radius for this spawn (0 = use default)
12
13
} wipeout_spawn_config ;
@@ -18,15 +19,16 @@ typedef struct wipeout_map_spawns_t
18
19
int spawn_count ;
19
20
} wipeout_map_spawns ;
20
21
21
- // Some spawns require a custom radius to prevent abuse
22
- // Using 0 defaults to a radius of 84 units
22
+ // { {coords}, angle, name, radius }
23
23
static wipeout_spawn_config dm3_spawns [] = {
24
- { { -880 , -232 , -16 }, "tele/sng" , 128 },
25
- { { 192 , -208 , -176 }, "big>ra" , 0 },
26
- { { 1472 , -928 , -24 }, "ya box" , 0 },
27
- { { 1520 , 432 , -88 }, "rl" , 300 },
28
- { { -632 , -680 , -16 }, "tele/ra" , 128 },
29
- { { 512 , 768 , 216 }, "lifts" , 128 }
24
+ { { -880 , -232 , -16 }, 90 , "tele/sng" , 400 },
25
+ { { 192 , -208 , -176 }, 90 , "big>ra" , 300 },
26
+ { { 1472 , -928 , -24 }, 90 , "ya box" , 200 },
27
+ { { 1520 , 432 , -88 }, 0 , "rl" , 400 },
28
+ { { -632 , -680 , -16 }, 90 , "tele/ra" , 400 },
29
+ { { 512 , 768 , 216 }, -90 , "lifts" , 300 },
30
+ { { -387 , 233 , -16 }, 0 , "sng" , 200 },
31
+ { { 2021 , -446 , -24 }, 180 , "bridge" , 400 }
30
32
};
31
33
32
34
static wipeout_map_spawns wipeout_spawn_configs [] = {
@@ -58,8 +60,7 @@ void EndRound(int alive_team);
58
60
void show_tracking_info (gedict_t * p );
59
61
60
62
// Wipeout spawn management functions
61
- static wipeout_spawn_config * WO_FindSpawnConfig (vec3_t origin );
62
- float WO_GetSpawnRadius (vec3_t origin );
63
+ float WO_GetSpawnRadius (gedict_t * spawn_point );
63
64
void WO_InitializeSpawns (void );
64
65
65
66
gedict_t * ca_find_player (gedict_t * p , gedict_t * observer )
@@ -666,7 +667,6 @@ void CA_PutClientInServer(void)
666
667
self -> spawn_delay = 0 ;
667
668
668
669
setmodel (self , "" );
669
- setorigin (self , PASSVEC3 (self -> s .v .origin ));
670
670
671
671
if (!self -> in_limbo || ca_round_pause )
672
672
{
@@ -1800,63 +1800,51 @@ void CA_Frame(void)
1800
1800
}
1801
1801
}
1802
1802
1803
- // Find spawn configuration for a given origin
1804
- static wipeout_spawn_config * WO_FindSpawnConfig (vec3_t origin )
1805
- {
1806
- int i , j ;
1807
-
1808
- if (cvar ("k_clan_arena" ) != 2 ) // Only for wipeout mode
1809
- {
1810
- return NULL ;
1811
- }
1812
-
1813
- // Find current map configuration
1814
- for (i = 0 ; wipeout_spawn_configs [i ].mapname ; i ++ )
1815
- {
1816
- if (streq (mapname , wipeout_spawn_configs [i ].mapname ))
1817
- {
1818
- // Search for matching spawn point
1819
- for (j = 0 ; j < wipeout_spawn_configs [i ].spawn_count ; j ++ )
1820
- {
1821
- if (VectorCompare (origin , wipeout_spawn_configs [i ].spawns [j ].origin ))
1822
- {
1823
- return & wipeout_spawn_configs [i ].spawns [j ];
1824
- }
1825
- }
1826
- break ;
1827
- }
1828
- }
1829
-
1830
- return NULL ;
1831
- }
1832
1803
1833
1804
// Get custom spawn radius for a spawn point
1834
- float WO_GetSpawnRadius (vec3_t origin )
1805
+ float WO_GetSpawnRadius (gedict_t * spawn_point )
1835
1806
{
1836
- wipeout_spawn_config * config = WO_FindSpawnConfig (origin );
1837
-
1838
- if (config && config -> custom_radius > 0 )
1807
+ if (spawn_point && spawn_point -> custom_radius > 0 )
1839
1808
{
1840
- return config -> custom_radius ;
1809
+ return spawn_point -> custom_radius ;
1841
1810
}
1842
1811
1843
1812
return 0 ; // Use default radius
1844
1813
}
1845
1814
1846
- // Initialize wipeout spawns (can be called to reload configurations)
1815
+ // Initialize wipeout spawns by creating info_player_wipeout entities
1816
+ // from the wipeout_spawn_configs array. These custom spawns are used
1817
+ // exclusively during wipeout mode
1847
1818
void WO_InitializeSpawns (void )
1848
1819
{
1849
1820
if (cvar ("k_clan_arena" ) == 2 )
1850
1821
{
1851
- int i ;
1822
+ int i , j ;
1852
1823
for (i = 0 ; wipeout_spawn_configs [i ].mapname ; i ++ )
1853
1824
{
1854
1825
if (streq (mapname , wipeout_spawn_configs [i ].mapname ))
1855
1826
{
1827
+ // Create spawn entities for each configured spawn point
1828
+ for (j = 0 ; j < wipeout_spawn_configs [i ].spawn_count ; j ++ )
1829
+ {
1830
+ gedict_t * spawn_ent = spawn ();
1831
+ wipeout_spawn_config * spawn_cfg = & wipeout_spawn_configs [i ].spawns [j ];
1832
+
1833
+ // Set entity properties
1834
+ spawn_ent -> classname = "info_player_wipeout" ;
1835
+
1836
+ // Set origin and angles
1837
+ VectorCopy (spawn_cfg -> origin , spawn_ent -> s .v .origin );
1838
+ VectorSet (spawn_ent -> s .v .angles , 0 , spawn_cfg -> angle , 0 );
1839
+
1840
+ // Custom wipeout radius
1841
+ spawn_ent -> custom_radius = spawn_cfg -> custom_radius ;
1842
+ }
1843
+
1856
1844
if (cvar ("developer" ))
1857
1845
{
1858
- G_bprint (2 , "Wipeout: Using custom spawn configuration for %s (%d spawns) \n" ,
1859
- mapname , wipeout_spawn_configs [i ].spawn_count );
1846
+ G_bprint (2 , "Wipeout: Created %d custom spawn points for %s\n" ,
1847
+ wipeout_spawn_configs [i ].spawn_count , mapname );
1860
1848
}
1861
1849
1862
1850
break ;
0 commit comments