Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beenade windows fix 2024 #244

Merged
merged 1 commit into from
Jun 14, 2024
Merged

beenade windows fix 2024 #244

merged 1 commit into from
Jun 14, 2024

Conversation

spacebake
Copy link
Owner

Beenade was broken on windows
(game was always either an instant loss, or would freeze the game with a do loop)

This PR fixes the issues which caused this.


first issue was in the nahoo_Array2D function (line 547):
var arr = array_create(w, array_create(h, def));

the second array_create only runs once, returning an array reference. then the second array_create sets all of its values to that array reference.
So now you have an array filled with references to the same array, meaning if you make any changes to one of them, it changes every single row in an identical way.

I changed this so all the rows use unique arrays (presumably as it was intended to).

strangely, this worked fine on HTML.


second issue was in the nahoo_c*m_process function (line 482)
flood = m;
seems that the function tried to make a copy of the map so that it could edit it for a flood fill test without editing the original map arrays. but it stopped making copies at some point and now instead, changes the original.

I'm assuming this used work (probably what used to happen is that the array got copied when it got passed into the function. yoyo made changes to copy-on-write that probably broke this ?)

i fixed this by making a true copy of the map, using a loop.


I believe everything should now work exactly as it did before yoyo broke this

@spacebake spacebake merged commit 9e6fe05 into main Jun 14, 2024
2 checks passed
@spacebake spacebake deleted the beenade_windows_fix_2024 branch August 3, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant