refactor: use xash3d physics interface to handle with linkents, so do not hook dlopen/dlsym while running under xash3d

add: force set sv_forcesimulating to 1 while running under xash3d
This commit is contained in:
dmitry 2021-09-30 16:37:40 +03:00
commit 3205e1253f
No known key found for this signature in database
GPG key ID: 8297CE728B7A7E37
10 changed files with 256 additions and 42 deletions

View file

@ -671,6 +671,17 @@ void Game::checkCvarsBounds () {
ctrl.msg ("Bogus value for cvar '%s', min is '%.1f' and max is '%.1f', and we're got '%s', value reverted to default '%.1f'.", var.reg.name, var.min, var.max, str, var.initial);
}
}
// special case for xash3d, by default engine is not calling startframe if no players on server, but our quota management and bot adding
// mechanism assumes that starframe is called even if no players on server, so, set the xash3d's sv_forcesimulating cvar to 1 in case it's not
if (is (GameFlags::Xash3D)) {
static cvar_t *sv_forcesimulating = engfuncs.pfnCVarGetPointer ("sv_forcesimulating");
if (sv_forcesimulating && sv_forcesimulating->value != 1.0f) {
game.print ("Force-enable Xash3D sv_forcesimulating cvar.");
engfuncs.pfnCVarSetFloat ("sv_forcesimulating", 1.0f);
}
}
}
void Game::registerCvars (bool gameVars) {