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

Update ClearArea* of Cops, Peds and Projectiles. #819

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

4mmonium
Copy link
Contributor

This PR modifies an incorrectly named parameter in the aforementioned natives.
The parameter was previously named flags, but this parameter actually defines whether a net event of CClearAreaEvent should be created or not upon native execution.

I'm not entirely sure if changing parameter types is ok to do so (as in won't break anything, never done such thing), if so I can just set the type back to integer, let me know if so, thanks.

@AvarianKnight
Copy link
Contributor

Don't arguments with their type changed need a cs_type to maintain compatibility with CS?

@4mmonium
Copy link
Contributor Author

Don't arguments with their type changed need a cs_type to maintain compatibility with CS?

Ah right, my bad.
https://github.com/citizenfx/natives/pull/819/files#diff-763fc62b945d7d5993004da239fe99184962d59f4ff0a6b181b4c248f16336eaL8

@4mmonium
Copy link
Contributor Author

4mmonium commented Sep 27, 2022

Ok, I believe I corrected it. I didn't do it for this native since it was previously done before, so I just switched it to the right type.

Nice catch btw, totally missed that 😀

Anyhow, this is where it parses the parameters.

```
flags appears to always be 0
Clears an area of cops at the given coordinates and radius.
`createNetEvent` specifies whether a `CClearAreaEvent` event of should be created for online use.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this line necessary considering its already defined in the parameters? (same goes for the other natives)

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 just corrected it, thanks!

This PR modifies an incorrectly named parameter in the aforementioned
natives. The parameter was previously named `flags`, but this parameter
actually defines whether a net event of `CClearAreaEvent` should be created or not upon native execution.

I'm not entirely sure if changing parameter types is ok to do so (as in
won't break anything, never done such thing), if so I can just set the type
back to integer, let me know if so, thanks.

Correct cs_type decls for ClearArea* natives

Correct cs_type declarations for ClearArea* natives to preserve
compatibility with C# scripts.

Preserve function signature

Preserve function signature for ClearAreaOfProjectiles.
Last parameter was changed from int to BOOL.

Remove redundant description about createNetEvent
Copy link
Contributor

@AvarianKnight AvarianKnight left a comment

Choose a reason for hiding this comment

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

Lgtm

@titanium-cfx titanium-cfx merged commit 42709b5 into citizenfx:master Jul 6, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants