Page 1 of 1
Contents of array gets reset for some reason...
Posted: Wed Dec 22, 2021 7:41 am
by tommcjeff
I'm trying to make a wire placing system, however when I "place" the second segment of the "wire", it suddenly deletes all the contents, and won't work anymore. When I view the length of the array in console, it suddenly goes to 0 for some reason, however the rendering "engine" still works. I've attached a .love file
, in the top left corner it says the mode (viewing mode by default), and you can press space to start placing the "wire".
Re: Contents of array gets reset for some reason...
Posted: Wed Dec 22, 2021 8:57 am
by togFox
No love file attached.
Re: Contents of array gets reset for some reason...
Posted: Wed Dec 22, 2021 9:25 am
by darkfrei
Re: Contents of array gets reset for some reason...
Posted: Wed Dec 22, 2021 9:54 am
by tommcjeff
togFox wrote: ↑Wed Dec 22, 2021 8:57 am
No love file attached.
Sorry, the website was haveing some "issues" when I was posting (random 404's), so it must've not gotten posted.
Re: Contents of array gets reset for some reason...
Posted: Wed Dec 22, 2021 11:16 am
by grump
Not a huge fan of playing debugger for other people, but this was glaringly obvious by looking at it, so I make an exception just for you:
You're passing currentnodeid to placewirenode in love.mousepressed, when you should be passing currentwireid instead.