I'm using Sugarcube 2, and I'm display a list of clothing that the user can choose to wear using a <<for>> loop and accessing an pre-configured array variable
eg. (formatted to aid readability)
<<display "Clothing Selector">>
The list displays ok, but clicking any "Wear" link acts as if the last item was clicked. This is because the reference to $csobj.name in the <<wearClothing>> macro tag is being stored as a reference, rather than the current value.
I need to somehow have <<wearClothing>> execute passing the name of the clothing item it corresponds to.