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

Fix unintended behavior for ped control states #3964

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

Conversation

Nico8340
Copy link
Contributor

Fixes #3874

@Nico8340 Nico8340 requested a review from tederis January 18, 2025 20:48
return SetControlState(szControl, bState);
}
if (&ped == GetLocalPlayer())
return SetControlState(control.data(), state);
Copy link
Member

Choose a reason for hiding this comment

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

Although std::string_view is acceptable in CLuaPedDefs, it's not recommended to use it here because SetPedControlState can potentially be called from any place and a string isn't guaranteed to be null-terminated. The same for GetPedControlState.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetPedControlState returns true for the other player when using setPedControlState for yourself
2 participants