Skip to content

Calling randi() % floor(2.0) causes engine to crash silently #80486

@jtiai

Description

@jtiai

Godot version

4.1.1.stable

System information

Godot v4.1.1.stable - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 (NVIDIA; 31.0.15.3640) - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 Threads)

Issue description

The following code causes game to crash silently:

var result = randi() % floor(10.0)

Steps to reproduce

Create a node, add the following code in _ready()

func _ready():
    var result = randi() % floor(10.0)
    print("Result: ", result)

Minimal reproduction project

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions