Skip to content

Fix integer vector mul/div operators and bindings. - #57607

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
reduz:fix-variant-vec-integer-float-mul-div
Feb 6, 2022
Merged

akien-mga merged 1 commit into
godotengine:masterfrom
reduz:fix-variant-vec-integer-float-mul-div

Conversation

@reduz

@reduz reduz commented Feb 3, 2022

Copy link
Copy Markdown
Member
  • Remove unnecesary overloads.
  • Vector2i and Vector3i mul/div by a float results in Vector2 and Vector3 respectively.
  • Create specializations to allow proper bindings.

This fixes #44408 and supersedes #44441 and keeps the same rule of int float returnig float, like with scalars.
WARNING: This most likely breaks GDScript *= operator for typed variables of V2i and V3i. @vnen should give it a check.

@reduz
reduz requested review from a team as code owners February 3, 2022 21:30
@Calinou Calinou added this to the 4.0 milestone Feb 3, 2022
Comment thread doc/classes/Vector2i.xml Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The documentation for the operators should be updated too as it documented the bugged behaviour.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@reduz You also need to update the code examples.