Re: Vehicle WEAPON names no longer shows up [message #487441 is a reply to message #487407] |
Thu, 01 May 2014 03:20 |
|
Here is TranslateDBClass::Add_Object from TranslateDBClass.cpp:
bool TranslateDBClass::Add_Object(TDBObjClass *object)
{
if (object)
{
if (object->Get_ID() <= 999)
{
object->Set_ID(Find_Unique_ID());
}
int id = object->Get_ID() - 1000;
while (m_ObjectList.Count() <= id)
{
TDBObjClass *obj = 0;
m_ObjectList.Add(obj);
}
m_ObjectList[id] = object;
StringClass str = object->Get_ID_Desc();
_strlwr(str.Peek_Buffer());
m_ObjectHash.Insert(str,object);
return true;
}
return false;
}
If you look at it, you can see clearly that it specifically adds empty strings such that the index into the array is always equal to the ID - 1000 (the while() loop in the code above)
In your example, element 0 in the array would contain string ID 1, element 1 would contain string ID 2, element 3 would be empty, element 4 would be empty, element 5 would contain string ID 6, element 6 would contain string ID 7, element 7 would be empty, element 8 would be empty and element 9 would contain string ID 10. Count would be 10.
Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
[Updated on: Thu, 01 May 2014 03:23] Report message to a moderator
|
|
|