r3933 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jul 26 15:23:32 EDT 2008


Author: div0
Date: 2008-07-26 15:23:32 -0400 (Sat, 26 Jul 2008)
New Revision: 3933

Modified:
   trunk/data/qcsrc/server/g_world.qc
Log:
add RestoreGame() hook to fix loaded games (they no longer erase server.db)


Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc	2008-07-26 18:35:15 UTC (rev 3932)
+++ trunk/data/qcsrc/server/g_world.qc	2008-07-26 19:23:32 UTC (rev 3933)
@@ -2270,6 +2270,25 @@
 	return TRUE;
 }
 
+void RestoreGame()
+{
+	// Loaded from a save game
+	// some things then break, so let's work around them...
+
+	// Progs DB (capture records)
+	if(sv_cheats)
+		ServerProgsDB = db_create();
+	else
+		ServerProgsDB = db_load("server.db");
+
+	// Mapinfo
+#ifdef MAPINFO
+	MapInfo_Shutdown();
+	MapInfo_Enumerate();
+	MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 1);
+#endif
+}
+
 void SV_Shutdown()
 {
 	if(world_initialized)




More information about the nexuiz-commits mailing list