McDeKi Posted June 1, 2014 Share Posted June 1, 2014 Hello. I've got array with items ( inventory ). The problem is when I have two elements with the same values but with different indexes. --//Pseudo code Inventory[1][6] = "Apple" Inventory[5][4] = "Apple" lua allocates those elements in the same place in memory, inventory[1][6] = "Apple" and Inventory[5][4] = "Apple" has the same space (table: 21D2E2A8) First item: Second item: Link to comment
50p Posted June 1, 2014 Share Posted June 1, 2014 You're showing the table's address in memory not the values themselves. tostring(Inventory); -- table: 21D2E2A8 This value will be the same everywhere in the code. Link to comment
McDeKi Posted June 1, 2014 Author Share Posted June 1, 2014 The value is different with two items. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now