Game Development Community

T3D 1.1 Preview - ArrayObject Issues and Crashes - LOGGED (THREED-1576) RESOLVED

by Steve Acaster · in Torque 3D Professional · 04/10/2011 (12:45 pm) · 4 replies

T3D 1.1 Preview

win7 32bit

target:
ArrayObject

Issue:
Various -
$myArray.echo(); returns:
Index   Key       Value
0    []    =>    
1    []    =>    
2    []    =>    
3    []    =>    
4    []    =>    
5    []    =>    
6    []    =>    
7    []    =>    
Though those entries are blank in console and are black backed SOH in notepad++.

Array don't seem to check through themselves correctly when functions are called to do so (I'll have a bit more experimenting with this).

Having multiple arrays working or cleared and then restocked with new data causes a crash.

Repeat:
For starters: Make an array, fill it with info, call an array.echo() on it.

Suggest:
Fix it!

[EDIT]
I now think that the crash is related to another issue and not this one - but there's obviously something amiss with arrayObject.

06-June2010 Fixed in 1.1 Final

#1
04/11/2011 (6:24 am)
Logged as THREED-1576.
#2
04/11/2011 (11:20 am)
Update:
It might just be the array.echo() that is returning junk. Moving the pointer next, previous and getting the actual info from the array indexes appears to be okay. It's a bit difficult to test the various array ordering commands though when I can't see the array list in the console.
#3
04/22/2011 (2:40 pm)
Hey, Steve.

Give this a shot.

in Engine\source\console\arrayObject.cpp
void ArrayObject::echo()
{
   Con::printf( "ArrayObject Listing:" );
   Con::printf( "Index   Key       Value" );
   for ( U32 i = 0; i < mArray.size(); i++ ) <-- LINE CHANGED
   {
      const String& key = mArray[i].key;
      const String& val = mArray[i].value;
      Con::printf( "%d      [%s]    =>    %s", i, key.c_str(), val.c_str() ); //<-- LINE CHANGED
   }
}

Lemmie know if there are any problems with that.
#4
04/22/2011 (6:52 pm)
Yeah that seems to work good, Ray. :)

1.bp.blogspot.com/_uq4ypP0SnYY/TIcJmY7aKNI/AAAAAAAAAjk/-2m0HomBDL4/s1600/Inspector+Clouseau+001.jpg
The case is solve-ed ...