This is a fork of Zandronum Beta for Mac Os (Silicon and Intel)
Revisão | ef07e2140416ae8814ec2d61dffa9e9ed1097ca9 (tree) |
---|---|
Hora | 2022-10-09 23:48:31 |
Autor | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Moved the lobby CVar definition from deathmatch.cpp into gamemode.cpp, deathmatch-based game modes aren't the only ones that use this CVar.
@@ -347,34 +347,6 @@ | ||
347 | 347 | SERVER_SettingChanged( self, true, 2 ); |
348 | 348 | } |
349 | 349 | |
350 | -// [AM] Set or unset a map as being a "lobby" map. | |
351 | -CUSTOM_CVAR( String, lobby, "", CVAR_SERVERINFO ) | |
352 | -{ | |
353 | - if ( strcmp( *self, "" ) == 0 ) | |
354 | - { | |
355 | - // Lobby map is empty. Tell the client that if necessary. | |
356 | - if (( NETWORK_GetState( ) == NETSTATE_SERVER ) && ( gamestate != GS_STARTUP )) | |
357 | - { | |
358 | - SERVER_Printf( PRINT_HIGH, "%s unset\n", self.GetName( )); | |
359 | - SERVERCOMMANDS_SetGameModeLimits( ); | |
360 | - } | |
361 | - } | |
362 | - else | |
363 | - { | |
364 | - // Prevent setting a lobby map that doesn't exist. | |
365 | - level_info_t *map = FindLevelByName( *self ); | |
366 | - if ( map == NULL ) | |
367 | - { | |
368 | - Printf( "map %s doesn't exist.\n", *self ); | |
369 | - self = ""; | |
370 | - return; | |
371 | - } | |
372 | - | |
373 | - // Update the client about the lobby map if necessary. | |
374 | - SERVER_SettingChanged( self, false ); | |
375 | - } | |
376 | -} | |
377 | - | |
378 | 350 | // Is this a good place for these variables? |
379 | 351 | CVAR( Bool, cl_noammoswitch, true, CVAR_ARCHIVE ); |
380 | 352 | CVAR( Bool, cl_useoriginalweaponorder, false, CVAR_ARCHIVE ); |
@@ -66,7 +66,6 @@ | ||
66 | 66 | |
67 | 67 | EXTERN_CVAR( Int, fraglimit ) |
68 | 68 | EXTERN_CVAR( Float, timelimit ) |
69 | -EXTERN_CVAR( String, lobby ) | |
70 | 69 | |
71 | 70 | EXTERN_CVAR( Bool, cl_noammoswitch ) |
72 | 71 | EXTERN_CVAR( Bool, cl_useoriginalweaponorder ) |
@@ -88,6 +88,34 @@ | ||
88 | 88 | SERVER_SettingChanged( self, false ); |
89 | 89 | } |
90 | 90 | |
91 | +// [AM] Set or unset a map as being a "lobby" map. | |
92 | +CUSTOM_CVAR( String, lobby, "", CVAR_SERVERINFO ) | |
93 | +{ | |
94 | + if ( strcmp( *self, "" ) == 0 ) | |
95 | + { | |
96 | + // Lobby map is empty. Tell the client that if necessary. | |
97 | + if (( NETWORK_GetState( ) == NETSTATE_SERVER ) && ( gamestate != GS_STARTUP )) | |
98 | + { | |
99 | + SERVER_Printf( PRINT_HIGH, "%s unset\n", self.GetName( )); | |
100 | + SERVERCOMMANDS_SetGameModeLimits( ); | |
101 | + } | |
102 | + } | |
103 | + else | |
104 | + { | |
105 | + // Prevent setting a lobby map that doesn't exist. | |
106 | + level_info_t *map = FindLevelByName( *self ); | |
107 | + if ( map == NULL ) | |
108 | + { | |
109 | + Printf( "map %s doesn't exist.\n", *self ); | |
110 | + self = ""; | |
111 | + return; | |
112 | + } | |
113 | + | |
114 | + // Update the client about the lobby map if necessary. | |
115 | + SERVER_SettingChanged( self, false ); | |
116 | + } | |
117 | +} | |
118 | + | |
91 | 119 | //***************************************************************************** |
92 | 120 | // VARIABLES |
93 | 121 |
@@ -76,6 +76,8 @@ | ||
76 | 76 | EXTERN_CVAR( Bool, sv_suddendeath ) |
77 | 77 | EXTERN_CVAR( Int, sv_maxlives ) |
78 | 78 | |
79 | +EXTERN_CVAR( String, lobby ) | |
80 | + | |
79 | 81 | //***************************************************************************** |
80 | 82 | typedef enum |
81 | 83 | { |