Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Update_PT_Data
Update_PT_Data [message #434635] Thu, 12 August 2010 03:45 Go to previous message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma:
General (1 Star)
I'm using the following function to set the data for the PT's

void LoadPTData(int loadTeam)
{
	INIClass *PTini = Get_INI("./PT_Data.ini");
	const int team = PTTEAM(loadTeam);
	char section[16];
	char presetIDEntry[16];
	unsigned int type = CHARACTERS;

	unsigned int cost = 0;
	unsigned int presetID = 0;
	unsigned int stringID = 0;
	char texture[32];

	if(!PTini)
	{
		Console_Output("PT data file could not be found. PT's unchanged!\n");
		return;
	}

	Console_Output("Team: %d\nPTTeam: %d\nType: %d\n", loadTeam, team, type);

	sprintf(presetIDEntry, "Team%d_PresetID", loadTeam);

	for(int i = 0; i < 10; i++)
	{
		sprintf(section, "Char%d", i);

		cost = PTini->Get_Int(section, "Cost", 0);
		presetID = PTini->Get_Int(section, presetIDEntry, 0);
		stringID = PTini->Get_Int(section, "StringID", 0);
		PTini->Get_String(section, "Texture", "", texture, 32);

		Console_Output("Section: %s\nCost: %d\nPresetID: %d\nStringID: %d\nTexture: %s\n", section, cost, presetID, stringID, texture);

		Set_Preset(team, type, i, cost, presetID, stringID, texture);

		for(int j = 0; j < 3; j++)
		{
			sprintf(section, "CharAlt%d%d", i, j);

			presetID = PTini->Get_Int(section, presetIDEntry, 0);
			PTini->Get_String(section, "Texture", "", texture, 32);

			Console_Output("AltSection: %s\nAltPresetID: %d\nAltTexture: %s\n", section, presetID, texture);

			Set_Alternate(team, type, i, j, presetID, texture);
		}
	}

	type = VEHICLES;

	for(int i = 0; i < 10; i++)
	{
		sprintf(section, "Veh%d", i);

		cost = PTini->Get_Int(section, "Cost", 0);
		presetID = PTini->Get_Int(section, presetIDEntry, 0);
		stringID = PTini->Get_Int(section, "StringID", 0);
		PTini->Get_String(section, "Texture", "", texture, 32);

		Console_Output("Section: %s\nCost: %d\nPresetID: %d\nStringID: %d\nTexture: %s\n", section, cost, presetID, stringID, texture);

		Set_Preset(team, type, i, cost, presetID, stringID, texture);

		for(int j = 0; j < 3; j++)
		{
			sprintf(section, "VehAlt%d%d", i, j);

			presetID = PTini->Get_Int(section, presetIDEntry, 0);
			PTini->Get_String(section, "Texture", "", texture, 32);

			Console_Output("AltSection: %s\nAltPresetID: %d\nAltTexture: %s\n", section, presetID, texture);

			Set_Alternate(team, type, i, j, presetID, texture);
		}
	}

	Update_PT_Data(); //Client crashes here
}

The server/FDS doesnt crash but the client does. Joining after the PT's have changed makes the client crash aswell.
I hope someone knows the problem and it's solution???


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg

[Updated on: Thu, 12 August 2010 03:53]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: START_TIMER Parameters
Next Topic: Ice textures in C&C Glacier
Goto Forum:
  


Current Time: Wed Dec 18 12:45:35 MST 2024

Total time taken to generate the page: 0.00620 seconds