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 )
@@ -664,7 +665,6 @@ void CA_PutClientInServer(void)
664
665
self -> spawn_delay = 0 ;
665
666
666
667
setmodel (self , "" );
667
- setorigin (self , PASSVEC3 (self -> s .v .origin ));
668
668
669
669
if (!self -> in_limbo || ca_round_pause )
670
670
{
@@ -1793,63 +1793,51 @@ void CA_Frame(void)
1793
1793
}
1794
1794
}
1795
1795
1796
- // Find spawn configuration for a given origin
1797
- static wipeout_spawn_config * WO_FindSpawnConfig (vec3_t origin )
1798
- {
1799
- int i , j ;
1800
-
1801
- if (cvar ("k_clan_arena" ) != 2 ) // Only for wipeout mode
1802
- {
1803
- return NULL ;
1804
- }
1805
-
1806
- // Find current map configuration
1807
- for (i = 0 ; wipeout_spawn_configs [i ].mapname ; i ++ )
1808
- {
1809
- if (streq (mapname , wipeout_spawn_configs [i ].mapname ))
1810
- {
1811
- // Search for matching spawn point
1812
- for (j = 0 ; j < wipeout_spawn_configs [i ].spawn_count ; j ++ )
1813
- {
1814
- if (VectorCompare (origin , wipeout_spawn_configs [i ].spawns [j ].origin ))
1815
- {
1816
- return & wipeout_spawn_configs [i ].spawns [j ];
1817
- }
1818
- }
1819
- break ;
1820
- }
1821
- }
1822
-
1823
- return NULL ;
1824
- }
1825
1796
1826
1797
// Get custom spawn radius for a spawn point
1827
- float WO_GetSpawnRadius (vec3_t origin )
1798
+ float WO_GetSpawnRadius (gedict_t * spawn_point )
1828
1799
{
1829
- wipeout_spawn_config * config = WO_FindSpawnConfig (origin );
1830
-
1831
- if (config && config -> custom_radius > 0 )
1800
+ if (spawn_point && spawn_point -> custom_radius > 0 )
1832
1801
{
1833
- return config -> custom_radius ;
1802
+ return spawn_point -> custom_radius ;
1834
1803
}
1835
1804
1836
1805
return 0 ; // Use default radius
1837
1806
}
1838
1807
1839
- // Initialize wipeout spawns (can be called to reload configurations)
1808
+ // Initialize wipeout spawns by creating info_player_wipeout entities
1809
+ // from the wipeout_spawn_configs array. These custom spawns are used
1810
+ // exclusively during wipeout mode
1840
1811
void WO_InitializeSpawns (void )
1841
1812
{
1842
1813
if (cvar ("k_clan_arena" ) == 2 )
1843
1814
{
1844
- int i ;
1815
+ int i , j ;
1845
1816
for (i = 0 ; wipeout_spawn_configs [i ].mapname ; i ++ )
1846
1817
{
1847
1818
if (streq (mapname , wipeout_spawn_configs [i ].mapname ))
1848
1819
{
1820
+ // Create spawn entities for each configured spawn point
1821
+ for (j = 0 ; j < wipeout_spawn_configs [i ].spawn_count ; j ++ )
1822
+ {
1823
+ gedict_t * spawn_ent = spawn ();
1824
+ wipeout_spawn_config * spawn_cfg = & wipeout_spawn_configs [i ].spawns [j ];
1825
+
1826
+ // Set entity properties
1827
+ spawn_ent -> classname = "info_player_wipeout" ;
1828
+
1829
+ // Set origin and angles
1830
+ VectorCopy (spawn_cfg -> origin , spawn_ent -> s .v .origin );
1831
+ VectorSet (spawn_ent -> s .v .angles , 0 , spawn_cfg -> angle , 0 );
1832
+
1833
+ // Custom wipeout radius
1834
+ spawn_ent -> custom_radius = spawn_cfg -> custom_radius ;
1835
+ }
1836
+
1849
1837
if (cvar ("developer" ))
1850
1838
{
1851
- G_bprint (2 , "Wipeout: Using custom spawn configuration for %s (%d spawns) \n" ,
1852
- mapname , wipeout_spawn_configs [i ].spawn_count );
1839
+ G_bprint (2 , "Wipeout: Created %d custom spawn points for %s\n" ,
1840
+ wipeout_spawn_configs [i ].spawn_count , mapname );
1853
1841
}
1854
1842
1855
1843
break ;
0 commit comments