wtf; MEDI was really borked

This commit is contained in:
Chris Forbes
2009-12-31 16:32:05 +13:00
parent d0c13c44b2
commit 493e207bbf
3 changed files with 5 additions and 3 deletions

View File

@@ -142,7 +142,9 @@ namespace OpenRa.Game.Traits
{
if (mi.Button == MouseButton.Left || underCursor == null) return null;
if (self == underCursor) return null;
if (underCursor.Owner == self.Owner && !mi.Modifiers.HasModifier( Modifiers.Ctrl )) return null;
var isHeal = Rules.WeaponInfo[self.Info.Primary].Damage < 0;
if (((underCursor.Owner == self.Owner) ^ isHeal)
&& !mi.Modifiers.HasModifier( Modifiers.Ctrl )) return null;
if (!Combat.HasAnyValidWeapons(self, underCursor)) return null;
return new Order("Attack", self, underCursor, int2.Zero, null);
}

View File

@@ -53,7 +53,7 @@ namespace OpenRa.Game.Traits
var inRange = Game.FindUnitsInCircle(self.CenterLocation, Game.CellSize * range);
return inRange
.Where(a => a.Owner == self.Owner) /* todo: one day deal with friendly players */
.Where(a => a.Owner == self.Owner && a != self) /* todo: one day deal with friendly players */
.Where(a => Combat.HasAnyValidWeapons(self, a))
.Where(a => a.Health < a.Info.Strength)
.OrderBy(a => (a.Location - self.Location).LengthSquared)

View File

@@ -590,7 +590,7 @@ LongDesc=Elite commando infantry, armed with \ndual pistols and C4.\n Strong vs
[MEDI]
Description=Medic
Voice=MedicVoice
Traits=Unit, Mobile, RenderInfantry, AttackBase, TakeCover, SquishByTank, AutoHeal
Traits=Unit, Mobile, RenderInfantry, AutoHeal, AttackBase, TakeCover, SquishByTank
LongDesc=Heals nearby infantry.\n Strong vs Nothing\n Weak vs Everything