READ MY POST BEFORE YOU MAKE YOURSELF LOOK STUPID
Ok, heres a little script thats part of the new mud system I'm working on.
PHP Code:
public function loadObject() {
temp.file = 0;
temp.vars = 0;
temp.i = 0;
temp.e = 0;
temp.s = 0;
file = new TStaticVar();
file.loadvars(format("%s/%s/%s.txt", MudControl.mudpath, this.mudtype, this.mudid));
MudControl.loadRefs(file);
echo("1:" @ file.muditems[0].mudid);
echo("2:" @ file.muditems[1].mudid);
vars = file.getVarNames();
vars.remove("mudid");
vars.remove("mudtype");
for (i = 0; i < vars.size(); i ++) {
//if (file.(@ vars[i]).type() != 3) {
this.(@ vars[i]) = file.(@ vars[i]);
//}
//else {
// s = file.(@ vars[i]).size();
// this.(@ vars[i]) = new [s];
// for (e = 0; e < s; e ++) {
// this.(@ vars[i])[e] = file.(@ vars[i])[e];
// }
//}
}
echo("3: " @ this.muditems[0].mudid);
echo("4: " @ this.muditems[1].mudid);
file.destroy();
triggerAll("onLoadedObject", null);
}
Now heres my problem, when an object is loaded it contains reference strings like
ref:item:20010 and
ref:item:20011 which were the two objects I was using for this test. Now the MudControl parses all these strings and returns the correct MudObject# for them.
This works all find and dandy because in echos 1 and 2 it correctly displays the MudID under all conditions, meaning the reference parser is fine. Now my problem was that echos 3 and 4 were blank even though I was simply copying an already existing reference array.
Now previously in the object is another variable, the reference to the archetype which is just a single reference and not an array, this was copied to the current object just fine in all cases. Now when I tried to copy the array of the two items as a whole, it didn't work for some reason and echos 3 and 4 were blank as I said. Now then, what I did was add in the lines that you see commented out and the script worked fine after that.
Is this a bug or something?