I noticed that when I passed tables as a parameter with Gamestate.switch(to, ...) the reference of this table was no longer the same, which caused me errors in a larger project where I put an instantiated class as a parameter and where its previously initialized values ended up on nil.
Here is an example to download that I did quickly to illustrate the problem, you have to see in the console for the references.
[SOLVED] (HUMP) 'Gamestate.switch' changes the references of the tables passed in parameters
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
[SOLVED] (HUMP) 'Gamestate.switch' changes the references of the tables passed in parameters
- Attachments
-
- Test-States.love
- (4.2 KiB) Downloaded 87 times
Last edited by Bigfoot71 on Wed Nov 09, 2022 8:28 pm, edited 1 time in total.
Re: (HUMP) 'Gamestate.switch' changes the references of the tables passed in parameters
My apologies, I didn't understand but the "method" :enter() takes a first parameter, I'll leave you this link to the doc which explains this if it ever happens to someone someone else: https://hump.readthedocs.io/en/latest/g ... ate.switch
Always RTFM, sorry
Always RTFM, sorry
Who is online
Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Bing [Bot], GetAsync, Google [Bot], Semrush [Bot] and 4 guests