Skip to content

Allow using std::variant with several pointers (Lua parser) #4224

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

Merged
merged 2 commits into from
May 20, 2025

Conversation

tederis
Copy link
Member

@tederis tederis commented May 14, 2025

Currently the Lua parser doesn't support constructions such as

static void SomeFn(std::variant<CClientPlayer*, CClientSound*> value)

This PR makes it possible. This opens new possibilities for the refactoring. With this PR it's now possible to rewrite function setSoundEffectEnabled using the new parser, for example.

@tederis tederis added the enhancement New feature or request label May 14, 2025
@tederis tederis changed the title Allow std::variant for element pointers (Lua parser) Allow using std::variant with several pointers (Lua parser) May 14, 2025
@sbx320
Copy link
Member

sbx320 commented May 20, 2025

Doesn't feel ideal to read the pointer multiple times, but I don't see an easy alternative either.

@sbx320 sbx320 merged commit 9d776c8 into multitheftauto:master May 20, 2025
6 checks passed
MTABot pushed a commit that referenced this pull request May 20, 2025
9d776c8 Allow using std::variant with several pointers (Lua parser) (#4224)
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.

2 participants