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

Add serverside isPedReloadingWeapon #3295

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

znvjder
Copy link
Contributor

@znvjder znvjder commented Jan 16, 2024

Adds a new function:

bool isPedReloadingWeapon(ped thisPed)

Related to #1525 and #1529 due to lack of compatibility with BitStream.

@znvjder znvjder marked this pull request as ready for review January 16, 2024 23:31
@@ -68,6 +68,7 @@ CPed::CPed(CPedManager* pPedManager, CElement* pParent, unsigned short usModel)
m_fGravity = 0.008f;
m_bDoingGangDriveby = false;
m_bStealthAiming = false;
m_bReloadingWeapon = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to move it into the member initializer list.

// Add new ones in separate structs
struct
{
bool bIsReloadingWeapon : 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just put it into the existing data struct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to maintain compatibility with older BitStream version on the server/client.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this it's enough to permute BITCOUNT depending on a bitstream version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Earlier, I tried to apply it like this, but there were issues with comparing the bitstream versions with different client <-> server versions.

@tederis tederis added the enhancement New feature or request label Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants