ChronoDK / GodotBigNumberClass

Use very BIG numbers in Godot Engine games.
MIT License
113 stars 27 forks source link

Bigs cannot be initialized with another Big #22

Closed NumbuhFour closed 1 year ago

NumbuhFour commented 1 year ago

If you try to do Big.new(another_big) to copy a Big, it fails to copy over the original's values.

The _init function of Big checks m.is_class("Big") but per https://github.com/godotengine/godot/issues/21789 this fails. The return of m.get_class() does not return "Big", but returns the native class "RefCounted", so an alternative solution is required.

Repro steps:

var some_big:Big = Big.new(99)
var copy_big:Big = Big.new(some_big)

Expected: copy_big's value should be 99 Result: copy_big's value is 0

This was found in Godot4 with source pulled from both godot and GodotBigNumberClass pulled today

ChronoDK commented 1 year ago

Thanks, I have fixed it right away!