I noticed something weird with arrays, and I'm not sure what's up. Whether it's a bug, whether I'm not understanding something about how arrays work, or whatever, idk.. 🤔
- Create a new GMS2 project
- Import GMLive.gml, place obj_gmlive in the room
- Create a new object, place it in the room
- Create event of the object:
if (live_call()) return live_result; a = "foo"; b = a; b = "bar"; show_debug_message("a = " + a + ", b = " + b);
- Step event of the object:
if keyboard_check_pressed(vk_space) room_restart();
- If live_enabled is set to 0 (i.e. live reloading not enabled), a = foo, b = bar shows up in the output console when the game is run, as well as whenever spacebar is pressed to restart the room. This is the behaviour I am expecting.
- If live_enabled is set to 1, a = foo, b = bar shows up in the output console when the game is run, but whenever the room is restarted, it now somehow becomes a = bar, b = bar, as if the array is suddenly getting passed by reference or something?