Page 1 of 1

[SOLVED] (HUMP) 'Gamestate.switch' changes the references of the tables passed in parameters

Posted: Wed Nov 09, 2022 6:00 pm
by Bigfoot71
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.

Re: (HUMP) 'Gamestate.switch' changes the references of the tables passed in parameters

Posted: Wed Nov 09, 2022 8:27 pm
by Bigfoot71
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 ^^