Skip to content

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