Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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