Game Development Community

Changing Array

by Richard_H · in Torque Game Engine · 03/09/2007 (5:43 pm) · 1 replies

Hi,

I have created an arrary that stores the several outputs of a function.
I initialized it like this:
StringTableEntry objects [maxX][maxY];
and I assign values like this:
objects[x][y] = Con::executef(2, "placePiece", sPrepedLine);
Everytime I set the value of one element all the others change, I believe that Con::executef is returning a value that changes everytime I use it. How can I get my array to stop changing?

#1
03/10/2007 (4:12 am)
Thanks to DEDEN on IRC, I was able to solve this.
objects[x][y] = StringTable->insert(Con::executef(2, "placePiece", sPrepedLine));
It appears I had to insert it into the string table to get the value without having it change.