Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Question regarding reviving buildings
Re: Question regarding reviving buildings [message #455193 is a reply to message #455191] Mon, 19 September 2011 09:33 Go to previous messageGo to previous message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma:
General (1 Star)
IDK what your 'Restore_Building' does but this is what it'd need to rebuild buildings (on 3.4.4 that is).

GameObject *o = As_BuildingGameObj(obj); //obj is your input GameObject
if (!o)
{
	return;
}
char *c = (char *)o;
c += 0x778;
bool *x = (bool *)c;
*x = false;

BaseControllerClass *b = BaseControllerClass::Find_Base(Get_Object_Type(o));
if (b && !Is_Building_Dead(o)) //Just to be sure it's revived
{
	if (Is_SoldierFactory(o))
	{
		b->CanGenerateSoldiers = true;
	}
	else if (Is_WarFactory(o) || Is_Airstrip(o))
	{
		b->CanGenerateVehicles = true;
	}
	else if(Is_PowerPlant(o))
	{
		b->IsPowered = true; //Ofcource you can have some feedback messages around this code (ie "Nod base power restored")
	}
	Set_Object_Dirty_Bit_All(b, DB_RARE, true);

	float max = Commands->Get_Max_Health(o);
	Commands->Set_Health(o, max);
}


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

[Updated on: Mon, 19 September 2011 09:39]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ChatHistory=C_Key doesnt work anymore
Next Topic: "Unit ready" spam sometimes after joining a 4.0 server
Goto Forum:
  


Current Time: Wed Nov 27 05:13:05 MST 2024

Total time taken to generate the page: 0.01361 seconds