• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

This is a fork of Zandronum Beta for Mac Os (Silicon and Intel)


Commit MetaInfo

Revisãoef07e2140416ae8814ec2d61dffa9e9ed1097ca9 (tree)
Hora2022-10-09 23:48:31
AutorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Mensagem de Log

Moved the lobby CVar definition from deathmatch.cpp into gamemode.cpp, deathmatch-based game modes aren't the only ones that use this CVar.

Mudança Sumário

Diff

diff -r a9ffaa9d8e53 -r ef07e2140416 src/deathmatch.cpp
--- a/src/deathmatch.cpp Sun Oct 09 10:46:33 2022 -0400
+++ b/src/deathmatch.cpp Sun Oct 09 10:48:31 2022 -0400
@@ -347,34 +347,6 @@
347347 SERVER_SettingChanged( self, true, 2 );
348348 }
349349
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-
378350 // Is this a good place for these variables?
379351 CVAR( Bool, cl_noammoswitch, true, CVAR_ARCHIVE );
380352 CVAR( Bool, cl_useoriginalweaponorder, false, CVAR_ARCHIVE );
diff -r a9ffaa9d8e53 -r ef07e2140416 src/deathmatch.h
--- a/src/deathmatch.h Sun Oct 09 10:46:33 2022 -0400
+++ b/src/deathmatch.h Sun Oct 09 10:48:31 2022 -0400
@@ -66,7 +66,6 @@
6666
6767 EXTERN_CVAR( Int, fraglimit )
6868 EXTERN_CVAR( Float, timelimit )
69-EXTERN_CVAR( String, lobby )
7069
7170 EXTERN_CVAR( Bool, cl_noammoswitch )
7271 EXTERN_CVAR( Bool, cl_useoriginalweaponorder )
diff -r a9ffaa9d8e53 -r ef07e2140416 src/gamemode.cpp
--- a/src/gamemode.cpp Sun Oct 09 10:46:33 2022 -0400
+++ b/src/gamemode.cpp Sun Oct 09 10:48:31 2022 -0400
@@ -88,6 +88,34 @@
8888 SERVER_SettingChanged( self, false );
8989 }
9090
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+
91119 //*****************************************************************************
92120 // VARIABLES
93121
diff -r a9ffaa9d8e53 -r ef07e2140416 src/gamemode.h
--- a/src/gamemode.h Sun Oct 09 10:46:33 2022 -0400
+++ b/src/gamemode.h Sun Oct 09 10:48:31 2022 -0400
@@ -76,6 +76,8 @@
7676 EXTERN_CVAR( Bool, sv_suddendeath )
7777 EXTERN_CVAR( Int, sv_maxlives )
7878
79+EXTERN_CVAR( String, lobby )
80+
7981 //*****************************************************************************
8082 typedef enum
8183 {