bot: improved logic when in freezetime
fix: full reset entvars of fakeclient upon entity creation fix: high skilled bots can't shoot with sniper weapons on short distances (ref #582) fix: fill server will not overflow number of bots anymore fix: do not treat dormant entites as valid clients for bots mgr: : single bot kick is now working in non-sequential order Co-Authored-By: Max <161382234+dyspose@users.noreply.github.com>
This commit is contained in:
parent
bd9286cf87
commit
4aa6aff8b6
9 changed files with 195 additions and 68 deletions
|
|
@ -1198,6 +1198,28 @@ void Game::ensureHealthyGameEnvironment () {
|
|||
}
|
||||
}
|
||||
|
||||
edict_t *Game::createFakeClient (StringRef name) {
|
||||
auto ent = engfuncs.pfnCreateFakeClient (name.chars ());
|
||||
|
||||
if (game.isNullEntity (ent)) {
|
||||
return nullptr;
|
||||
}
|
||||
auto netname = ent->v.netname;
|
||||
ent->v = {}; // reset entire the entvars structure (fix from regamedll)
|
||||
|
||||
// restore containing entity, name and client flags
|
||||
ent->v.pContainingEntity = ent;
|
||||
ent->v.flags = FL_FAKECLIENT | FL_CLIENT;
|
||||
ent->v.netname = netname;
|
||||
|
||||
if (ent->pvPrivateData != nullptr) {
|
||||
engfuncs.pfnFreeEntPrivateData (ent);
|
||||
}
|
||||
ent->pvPrivateData = nullptr;
|
||||
|
||||
return ent;
|
||||
}
|
||||
|
||||
void LightMeasure::initializeLightstyles () {
|
||||
// this function initializes lighting information...
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue