From 4c234c2c272395545b5b06ab35521032fcab1696 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 20 Mar 2007 13:23:17 +0000 Subject: [PATCH] ensure entities are cleared at map change (fixes segfault) --- qw/source/cl_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index a5f68cdc3..a7ba5d76d 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -1117,7 +1117,16 @@ CL_Rotate_f (void) void CL_SetState (cactive_t state) { + static const char *state_names[] = { + "ca_disconnected", + "ca_demostate", + "ca_connected", + "ca_onserver", + "ca_active", + }; cactive_t old_state = cls.state; + + Con_DPrintf ("CL_SetState (%s)\n", state_names[state]); cls.state = state; if (old_state != state) { if (old_state == ca_active) { @@ -1134,6 +1143,7 @@ CL_SetState (cactive_t state) // entering active state VID_SetCaption (cls.servername); IN_ClearStates (); + R_ClearEnts (); r_active = true; game_target = IMT_0; key_dest = key_game;