Skip to content

Molang rewrite attempts to turn math constants into functions #485

@tryashtar

Description

@tryashtar

In a molang expression that prompts a rewrite, constants like math.pi are rewritten incorrectly, adding parentheses to the constant.

This expression 5*3*math.pi should be turned into 15*math.pi, but the suggestion writes it as 15*math.pi(), and performing the rewrite instead puts the even-worse 5*3(math.pi() * 15).pi.

{
    "format_version": "1.26.30",
    "animations": {
        "animation.test": {
            "timeline": {
                "0.0": "v.test=5*3*math.pi;"
            }
        }
    }
}
Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions