Commits

Torr_Samaho committed 9d297e9

Fixed: When the ACS command ResetMap was executed by the server, the clients were not instructed to do their part of the map reset, e.g. removing decals and CLIENTSIDEONLY actors.

Comments (0)

Files changed (5)

 					pActor->FastChaseStrafeCount = lStrafeCount;
 				}
 				break;
+
+			case SVC2_RESETMAP:
+				GAME_ResetMap();
+				break;
+
 			default:
 				sprintf( szString, "CLIENT_ParsePacket: Illegible server message: %d\nLast command: %d\n", static_cast<int> (lExtCommand), static_cast<int> (g_lLastCmd) );
 				CLIENT_QuitNetworkGame( szString );
 			// [BB] If we are supposed to reset the map, do that now.
 			if ( GAME_IsMapRestRequested() )
 			{
+				// [BB] Tell the clients to do their part of the map reset and do so
+				// before doing the map reset on the server.
+				if ( NETWORK_GetState( ) == NETSTATE_SERVER )
+					SERVERCOMMANDS_ResetMap();
+
 				GAME_ResetMap( );
 				GAMEMODE_RespawnAllPlayers ( );
 			}

src/network_enums.h

 	ENUM_ELEMENT ( SVC2_SETHEXENARMORSLOTS ),
 	ENUM_ELEMENT ( SVC2_SETTHINGREACTIONTIME ),
 	ENUM_ELEMENT ( SVC2_SETFASTCHASESTRAFECOUNT ),
+	ENUM_ELEMENT ( SVC2_RESETMAP ),
 
 	ENUM_ELEMENT ( NUM_SVC2_COMMANDS ),
 }

src/sv_commands.cpp

 
 //*****************************************************************************
 //
+void SERVERCOMMANDS_ResetMap( ULONG ulPlayerExtra, ULONG ulFlags )
+{
+	NetCommand command( SVC_EXTENDEDCOMMAND );
+	command.addByte( SVC2_RESETMAP );
+	command.sendCommandToClients( ulPlayerExtra, ulFlags );
+}
+
+//*****************************************************************************
+//
 void SERVERCOMMANDS_SetIgnoreWeaponSelect( ULONG ulClient, const bool bIgnoreWeaponSelect )
 {
 	SERVER_CheckClientBuffer( ulClient, 3, true );

src/sv_commands.h

 void	SERVERCOMMANDS_ForceLightning( const int Mode, ULONG ulPlayerExtra = MAXPLAYERS, ULONG ulFlags = 0 );
 void	SERVERCOMMANDS_CancelFade( const ULONG ulPlayer, ULONG ulPlayerExtra = MAXPLAYERS, ULONG ulFlags = 0 );
 void	SERVERCOMMANDS_PlayBounceSound( const AActor *pActor, const bool bOnfloor, ULONG ulPlayerExtra = MAXPLAYERS, ULONG ulFlags = 0 );
+void	SERVERCOMMANDS_ResetMap( ULONG ulPlayerExtra = MAXPLAYERS, ULONG ulFlags = 0 );
 
 #endif	// __SV_COMMANDS_H__