From 882d8afc93da74681f2147995c9614a88979cce2 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 4 Oct 2024 01:28:22 +0300 Subject: [PATCH] engine: server: stub SV_RestartDecals for dedicated server --- engine/server/sv_game.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/engine/server/sv_game.c b/engine/server/sv_game.c index 518869fe..3b1da4fb 100644 --- a/engine/server/sv_game.c +++ b/engine/server/sv_game.c @@ -672,7 +672,7 @@ void SV_RestartAmbientSounds( void ) { SV_StartMusic( curtrack, looptrack, position ); } -#endif +#endif // !XASH_DEDICATED } /* @@ -684,31 +684,25 @@ Write all the decals into demo */ void SV_RestartDecals( void ) { + // TODO: similar to SV_RestartAmbientSounds, this is only used for demo recording + // and better be reimplemented on client side +#if !XASH_DEDICATED decallist_t *list; int decalIndex; int modelIndex; sizebuf_t *msg; int i, numdecals; - if( !SV_Active( )) return; + if( !SV_Active( ) || Host_IsDedicated( )) + return; // g-cont. add space for studiodecals if present list = (decallist_t *)Z_Calloc( sizeof( decallist_t ) * MAX_RENDER_DECALS * 2 ); -#if !XASH_DEDICATED - if( !Host_IsDedicated() ) - { - numdecals = ref.dllFuncs.R_CreateDecalList( list ); + numdecals = ref.dllFuncs.R_CreateDecalList( list ); - // remove decals from map - ref.dllFuncs.R_ClearAllDecals(); - } - else -#endif // XASH_DEDICATED - { - // we probably running a dedicated server - numdecals = 0; - } + // remove decals from map + ref.dllFuncs.R_ClearAllDecals(); // write decals into reliable datagram msg = SV_GetReliableDatagram(); @@ -731,6 +725,7 @@ void SV_RestartDecals( void ) } Z_Free( list ); +#endif // !XASH_DEDICATED } /*