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 support for duplicate() for Packed*Array, and they are pass by ref in godot 4.0 #44472

Merged

Conversation

jordo
Copy link
Contributor

@jordo jordo commented Dec 17, 2020

As discussed with @reduz on IRC.

I encountered a few more gdscript bugs in my project I'm developing on 4.0, with Packed*Arrays. (They are now pass by ref in godot 4.0, instead of pass by value).

This PR adds to Variant::duplicate() method to correctly copy Packed_Arrays on duplicate(). As well exposes a duplicate() function on each Packed*Array to do an explicit copy if desired. Note there is no argument '(deep)' boolean these arrays as that doesn't make sense.

This PR also updates the documentation for these classes accordingly.

@jordo jordo requested a review from a team as a code owner December 17, 2020 20:51
@akien-mga
Copy link
Member

It's best not to update the translations, this is done ne via a script and only after syncing with Weblate, otherwise we can lose translated content. (I haven't synced in a long time though as I'm waiting for the API to be more stable.)

@jordo
Copy link
Contributor Author

jordo commented Dec 17, 2020

@akien-mga Sry, i didn't know how localizations are done. What files would you like me to revert? All the .po's?

@akien-mga
Copy link
Member

Yeah .po and .pot files.

@jordo
Copy link
Contributor Author

jordo commented Dec 17, 2020

@akien-mga ok fixed.

@akien-mga akien-mga requested a review from reduz December 21, 2020 16:10
@akien-mga akien-mga merged commit 6532596 into godotengine:master Dec 21, 2020
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

4 participants