I've encountered a bug where vectors and f64 userdata doesn't get saved in the pod format.
This code:
local foo = vec(10, 10) print(tostr(foo), 10, 10, 7) print(pod(foo), 10, 20, 7) print(tostr(unpod(pod(foo))), 10, 30, 7) local bar = userdata("f64", 2) bar.x = 10 bar.y = 10 print(tostr(bar), 10, 50, 7) print(pod(bar), 10, 60, 7) print(tostr(unpod(pod(bar))), 10, 70, 7) |
prints:
(10.00000, 10.00000) userdata("f64",2,"") (0.00000, 0.00000) (10.00000, 10.00000) userdata("f64",2,"") (0.00000, 0.00000) |
You can see that pod() doesn't save the values for the userdata.
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/92447/Logo.png)
!!??
Is running the code in the terminal different to running it in a program?
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/38029/2_Picotron 2024_05_12 0_22_57.png)
I wrote some code to display it in a window. It is as follows.
It works as if nothing happened.
function _init() window(200, 120) end function _update() end function _draw() cls() local foo = vec(10, 10) print(tostr(foo), 10, 10, 7) print(pod(foo), 10, 20, 7) print(tostr(unpod(pod(foo))), 10, 30, 7) local bar = userdata("f64", 2) bar.x = 10 bar.y = 10 print(tostr(bar), 10, 50, 7) print(pod(bar), 10, 60, 7) print(tostr(unpod(pod(bar))), 10, 70, 7) end |
![](/media/38029/スクリーンショット 2024-05-25 002853.png)
![](/gfx/set_like0.png)
1
![](/gfx/top_drop.png)
![](/media/92447/Logo.png)
Oh! I'm on 0.1.0f, I didn't realise there was an update.
EDIT: Yeah, it works now. Oops!
[Please log in to post a comment]