Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Vehicle WEAPON names no longer shows up
Re: Vehicle WEAPON names no longer shows up [message #487441 is a reply to message #487407] Thu, 01 May 2014 03:20 Go to previous messageGo to previous message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma:
General (3 Stars)

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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Feature request, clients update objectives
Next Topic: tdbedit.exe fails to list the strings I have under the default tab in my strings file.
Goto Forum:
  


Current Time: Sat Dec 21 23:07:52 MST 2024

Total time taken to generate the page: 0.01090 seconds