Skip to content

Commit

Permalink
Changes to do with rebase.
Browse files Browse the repository at this point in the history
  • Loading branch information
MustaphaTR committed Feb 27, 2018
1 parent 98e4df2 commit 7a8f045
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public override void DoImpact(Target target, Actor firedBy, IEnumerable<int> dam
if (!IsValidImpact(pos, firedBy))
return;

var availableActors = firedBy.World.FindActorsInCircle(pos, Range + VictimScanRadius);
var availableActors = firedBy.World.FindActorsInCircle(pos, Range);
foreach (var actor in availableActors)
{
if (!IsValidAgainst(actor, firedBy))
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Gen/Traits/Warheads/CaptureActorWarhead.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public override void DoImpact(Target target, Actor firedBy, IEnumerable<int> dam
if (!IsValidImpact(pos, firedBy))
return;

var availableActors = firedBy.World.FindActorsInCircle(pos, Range + VictimScanRadius);
var availableActors = firedBy.World.FindActorsInCircle(pos, Range);

foreach (var a in availableActors)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public override void DoImpact(Target target, Actor firedBy, IEnumerable<int> dam
if (!IsValidImpact(pos, firedBy))
return;

var availableActors = firedBy.World.FindActorsInCircle(pos, Range + VictimScanRadius);
var availableActors = firedBy.World.FindActorsInCircle(pos, Range);
foreach (var actor in availableActors)
{
if (!IsValidAgainst(actor, firedBy))
Expand Down
15 changes: 4 additions & 11 deletions OpenRA.Mods.Gen/Traits/Warheads/WarheadAS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ namespace OpenRA.Mods.Yupgi_alert.Warheads
{
[Desc("AS warhead extension class." +
"These warheads check for the Air TargetType when detonated inair!")]
public abstract class WarheadAS : Warhead, IRulesetLoaded<WeaponInfo>
public abstract class WarheadAS : Warhead
{
[Desc("Extra search radius beyond maximum spread. If set to zero (default), it will automatically scale to the largest health shape.",
"Custom overrides should not be necessary under normal circumstances.")]
public WDist VictimScanRadius = WDist.Zero;
[Desc("Whether to consider actors in determining whether the explosion should happen. If false, only terrain will be considered.")]
public readonly bool ImpactActors = true;

public ImpactType GetImpactType(World world, CPos cell, WPos pos, Actor firedBy)
{
Expand All @@ -47,7 +46,7 @@ public ImpactType GetImpactType(World world, CPos cell, WPos pos, Actor firedBy)

public bool GetDirectHit(World world, CPos cell, WPos pos, Actor firedBy, bool checkTargetType = false)
{
foreach (var victim in world.FindActorsInCircle(pos, VictimScanRadius))
foreach (var victim in world.FindActorsInCircle(pos, WDist.Zero))
{
if (checkTargetType && !IsValidAgainst(victim, firedBy))
continue;
Expand Down Expand Up @@ -90,11 +89,5 @@ public bool IsValidImpact(WPos pos, Actor firedBy)

return validImpact;
}

void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo info)
{
if (VictimScanRadius == WDist.Zero)
VictimScanRadius = Util.MinimumRequiredVictimScanRadius(rules);
}
}
}

0 comments on commit 7a8f045

Please sign in to comment.