[iortcw] 134/497: SP: Fix demo playback crashing if starts on last map loaded by server

Simon McVittie smcv at debian.org
Fri Sep 8 10:36:38 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit e76dcf62e6a164861f94b122d4e7f090de8b6bba
Author: ZTurtleMan at gmail.com <ZTurtleMan at gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date:   Sat Jun 7 20:47:58 2014 +0000

    SP: Fix demo playback crashing if starts on last map loaded by server
---
 SP/code/client/cl_main.c    |  4 ++--
 SP/code/qcommon/cm_load.c   | 10 ++++++++++
 SP/code/qcommon/cm_public.h |  2 ++
 SP/code/server/sv_init.c    |  4 ++--
 4 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/SP/code/client/cl_main.c b/SP/code/client/cl_main.c
index d2db3a9..e39dbdd 100644
--- a/SP/code/client/cl_main.c
+++ b/SP/code/client/cl_main.c
@@ -1266,8 +1266,8 @@ void CL_ClearMemory(qboolean shutdownRef)
 	if ( !com_sv_running->integer ) {
 		// clear the whole hunk
 		Hunk_Clear();
-//		// clear collision map data
-//		CM_ClearMap();
+		// clear collision map data
+		CM_ClearMap();
 	} else {
 		// clear all the client data on the hunk
 		Hunk_ClearToMark();
diff --git a/SP/code/qcommon/cm_load.c b/SP/code/qcommon/cm_load.c
index c2b62b0..a7f5235 100644
--- a/SP/code/qcommon/cm_load.c
+++ b/SP/code/qcommon/cm_load.c
@@ -699,6 +699,16 @@ void CM_LoadMap( const char *name, qboolean clientload, int *checksum ) {
 
 /*
 ==================
+CM_ClearMap
+==================
+*/
+void CM_ClearMap( void ) {
+	Com_Memset( &cm, 0, sizeof( cm ) );
+	CM_ClearLevelPatches();
+}
+
+/*
+==================
 CM_ClipHandleToModel
 ==================
 */
diff --git a/SP/code/qcommon/cm_public.h b/SP/code/qcommon/cm_public.h
index e2e2d1c..6319a28 100644
--- a/SP/code/qcommon/cm_public.h
+++ b/SP/code/qcommon/cm_public.h
@@ -32,6 +32,8 @@ If you have questions concerning this license or the applicable additional terms
 #include "../renderer/tr_types.h"
 
 void        CM_LoadMap( const char *name, qboolean clientload, int *checksum );
+void        CM_ClearMap( void );
+
 clipHandle_t CM_InlineModel( int index );       // 0 = world, 1 + are bmodels
 clipHandle_t CM_TempBoxModel( const vec3_t mins, const vec3_t maxs, int capsule );
 
diff --git a/SP/code/server/sv_init.c b/SP/code/server/sv_init.c
index 4d7ddf9..cddcb8f 100644
--- a/SP/code/server/sv_init.c
+++ b/SP/code/server/sv_init.c
@@ -743,8 +743,8 @@ void SV_SpawnServer( char *server, qboolean killBots ) {
 	// clear the whole hunk because we're (re)loading the server
 	Hunk_Clear();
 
-//	// clear collision map data		// (SA) NOTE: TODO: used in missionpack
-//	CM_ClearMap();
+	// clear collision map data
+	CM_ClearMap();
 
 	// init client structures and svs.numSnapshotEntities
 	if ( !Cvar_VariableValue( "sv_running" ) ) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list