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.");
}
}
}
}
[Updated on: Tue, 12 March 2013 12:25]
Report message to a moderator