Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » Dragonade 1.1
Re: Dragonade 1.1 [message #479806 is a reply to message #479779] Tue, 12 March 2013 12:25 Go to previous messageGo to previous message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma:
General (4 Stars)
Just checked it and it checks the damage radius to distance between closest poly and the beacon object, so it's good yeah.

void DAC4BeaconManager::Object_Created_Event(GameObject *obj) {
	BeaconGameObj *Beacon = (BeaconGameObj*)obj;
	if (Beacon->Get_Owner()) {
		BuildingGameObj *Building = Get_Closest_Building(Beacon->Get_Position(),Beacon->Get_Player_Type()?0:1);
		if (Building) {
			ExplosionDefinitionClass *Explosion = (ExplosionDefinitionClass*)Find_Definition(Beacon->Get_Definition().ExplosionObjDef);
			float DamageRadius = Explosion->DamageRadius*Explosion->DamageRadius;
			float Distance = 0.0f;
			Building->Find_Closest_Poly(Beacon->Get_Position(),&Distance);
			if (Distance > DamageRadius) {
				Set_Bullets(Beacon->Get_Owner(),Beacon->Get_WeaponDef()->Get_Name(),2);
				Beacon->Set_Delete_Pending();
				DA::Page_Player(Beacon->Get_Owner(),"Beacons may only be deployed where they would damage an enemy building.");
			}
		}
	}
}


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Tue, 12 March 2013 12:25]

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
Previous Topic: [SSGM Plugin 4.0] LuaTT 1.2
Next Topic: Dragonade 1.2
Goto Forum:
  


Current Time: Tue Dec 03 15:18:16 MST 2024

Total time taken to generate the page: 0.01320 seconds