Move Shape from Health to new HitShape trait
Renamed Shape to Type
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Graphics;
|
||||
@@ -302,12 +303,9 @@ namespace OpenRA.Mods.Common.Projectiles
|
||||
if (!info.ValidBounceBlockerStances.HasStance(victim.Owner.Stances[firedBy.Owner]))
|
||||
continue;
|
||||
|
||||
var healthInfo = victim.Info.TraitInfoOrDefault<HealthInfo>();
|
||||
if (healthInfo == null)
|
||||
continue;
|
||||
|
||||
// If the impact position is within any actor's HitShape, we have a direct hit
|
||||
if (healthInfo.Shape.DistanceFromEdge(pos, victim).Length <= 0)
|
||||
var activeShapes = victim.TraitsImplementing<HitShape>().Where(Exts.IsTraitEnabled);
|
||||
if (activeShapes.Any(i => i.Info.Type.DistanceFromEdge(pos, victim).Length <= 0))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user