diff --git a/rehlds/HLTV/Core/src/BSPModel.cpp b/rehlds/HLTV/Core/src/BSPModel.cpp index 01c70f2..72ff7a2 100644 --- a/rehlds/HLTV/Core/src/BSPModel.cpp +++ b/rehlds/HLTV/Core/src/BSPModel.cpp @@ -175,12 +175,7 @@ byte *BSPModel::DecompressVis(unsigned char *in) return m_novis; } - int row = (m_model.numleafs + 7) / 8; - if (row < 0 || row > MODEL_MAX_PVS) { - m_System->Errorf("BSPModel::DecompressVis: oversized m_model.numleafs: %i\n", m_model.numleafs); - } - - DecompressPVS(in, decompressed, row); + DecompressPVS(in, decompressed, (m_model.numleafs + 7) / 8); return decompressed; } diff --git a/rehlds/engine/cmodel.cpp b/rehlds/engine/cmodel.cpp index 513163c..1e48512 100644 --- a/rehlds/engine/cmodel.cpp +++ b/rehlds/engine/cmodel.cpp @@ -47,18 +47,8 @@ unsigned char *Mod_DecompressVis(unsigned char *in, model_t *model) { return mod_novis; } -#ifdef REHLDS_FIXES + CM_DecompressPVS(in, decompressed, (model->numleafs + 7) / 8); -#else - int row = (model->numleafs + 7) / 8; - - if (row < 0 || row > MODEL_MAX_PVS) - { - Sys_Error("%s: oversized model->numleafs: %i", __func__, model->numleafs); - } - - CM_DecompressPVS(in, decompressed, row); -#endif return decompressed; } diff --git a/rehlds/engine/model.cpp b/rehlds/engine/model.cpp index 1bc30e7..11b3214 100644 --- a/rehlds/engine/model.cpp +++ b/rehlds/engine/model.cpp @@ -1036,18 +1036,7 @@ void Mod_LoadLeafs(lump_t *l) loadmodel->leafs = out; loadmodel->numleafs = count; -#ifdef REHLDS_FIXES - // Originally check was called only in singleplayer mode, that is why this "if" here (see Mod_LeafPVS, gPVS is not NULL for multiplayer) - if (g_psvs.maxclients <= 1) - { - int row = (loadmodel->numleafs + 7) / 8; - if (row < 0 || row > MODEL_MAX_PVS) - { - Sys_Error("%s: oversized loadmodel->numleafs: %i", __func__, loadmodel->numleafs); - } - } -#endif for (i = 0; i < count; i++, in++, out++) { for (j = 0; j < 3; j++) diff --git a/rehlds/engine/sv_main.cpp b/rehlds/engine/sv_main.cpp index e004ce7..b26d57c 100644 --- a/rehlds/engine/sv_main.cpp +++ b/rehlds/engine/sv_main.cpp @@ -6041,6 +6041,18 @@ int SV_SpawnServer(qboolean bIsDemo, char *server, char *startspot) return 0; } +#ifdef REHLDS_FIXES + // Originally check was called only in singleplayer mode, that is why this "if" here (see Mod_LeafPVS, gPVS is not NULL for multiplayer) + if (g_psvs.maxclients <= 1) + { + int row = (g_psv.worldmodel->numleafs + 7) / 8; + if (row < 0 || row > MODEL_MAX_PVS) + { + Sys_Error("%s: oversized g_psv.worldmodel->numleafs: %i", __func__, g_psv.worldmodel->numleafs); + } + } +#endif + Sequence_OnLevelLoad(server); ContinueLoadingProgressBar("Server", 4, 0.0); if (gmodinfo.clientcrccheck) @@ -6168,7 +6180,7 @@ void SV_LoadEntities(void) Con_Printf("Using default entities...\n"); } - + #endif // REHLDS_FIXES ED_LoadFromFile(g_psv.worldmodel->entities); }