Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FL_FAKECLIENT flag is cleared in some places #3256

Open
SamVanheer opened this issue Mar 9, 2022 · 1 comment
Open

FL_FAKECLIENT flag is cleared in some places #3256

SamVanheer opened this issue Mar 9, 2022 · 1 comment

Comments

@SamVanheer
Copy link

The FL_FAKECLIENT flag is cleared in some places which can cause problems with bots.

Change this:

halflife/dlls/player.cpp

Lines 2859 to 2860 in c7240b9

pev->flags &= FL_PROXY; // keep proxy flag sey by engine
pev->flags |= FL_CLIENT;

To this:

pev->flags &= FL_PROXY | FL_FAKECLIENT; // keep proxy and fakeclient flags set by engine
pev->flags |= FL_CLIENT;

In Opposing Force there are also a few cases:

In CBasePlayer::Menu_Char_Input there is code to reset players that are going from observer mode to joining a time. This line is part of that:

pev->flags = FL_CLIENT;

Change this to:

pev->flags &= FL_FAKECLIENT;
pev->flags |= FL_CLIENT;

Much like the code above this keeps the fake client flag and sets the client flag as originally intended. The proxy flag isn't needed here because it only applies to HLTV spectators, who can't participate in gameplay.

In CDisplacerBall::BallTouch there is code to teleport players hit by Displacer balls. This line is part of that:

pPlayer->pev->flags = FL_CLIENT;

Change this to:

//Clear any flags set on player (onground, using grapple, etc).
pPlayer->pev->flags &= FL_FAKECLIENT;
pPlayer->pev->flags |= FL_CLIENT;

Other games may also have similar code.

SamVanheer added a commit to twhl-community/halflife-op4-updated that referenced this issue Mar 9, 2022
SamVanheer added a commit to twhl-community/halflife-op4-updated that referenced this issue Mar 9, 2022
@tschumann
Copy link

Well-spotted.

I've done a bit of bot development and I haven't noticed anything strange with this.

SamVanheer added a commit to twhl-community/halflife-unified-sdk that referenced this issue Mar 17, 2022
@SamVanheer SamVanheer reopened this May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants