fakequeries: fixed hooking problems on certain providers

linkage: added support for fake steam ids for bots controlled via yb_enable_fake_steamids)

note that fake steam ids just used for give ability server owners to run statistics modules with tracking by steam ids ant not nicknames.
This commit is contained in:
jeefo 2024-01-19 18:29:20 +03:00
commit 1dc1043f7d
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
5 changed files with 42 additions and 1 deletions

View file

@ -534,6 +534,22 @@ CR_LINKAGE_C int GetEngineFunctions (enginefuncs_t *table, int *) {
};
}
table->pfnGetPlayerAuthId = [] (edict_t *e) -> const char * {
if (bots[e]) {
auto authid = util.getFakeSteamId (e);
if (game.is (GameFlags::Metamod)) {
RETURN_META_VALUE (MRES_SUPERCEDE, authid.chars ());
}
return authid.chars ();
}
if (game.is (GameFlags::Metamod)) {
RETURN_META_VALUE (MRES_IGNORED, nullptr);
}
return engfuncs.pfnGetPlayerAuthId (e);
};
table->pfnEmitSound = [] (edict_t *entity, int channel, const char *sample, float volume, float attenuation, int flags, int pitch) {
// this function tells the engine that the entity pointed to by "entity", is emitting a sound
// which fileName is "sample", at level "channel" (CHAN_VOICE, etc...), with "volume" as