Merge pull request #3545 from pchote/infantry-range-fix

Infantry range fix
This commit is contained in:
Matthias Mailänder
2013-07-11 11:45:15 -07:00
36 changed files with 219 additions and 177 deletions

View File

@@ -79,7 +79,7 @@ namespace OpenRA
public static void SetListenerPosition(float2 position) { soundEngine.SetListenerPosition(position); }
static ISound Play(Player player, string name, bool headRelative, PPos pos, float volumeModifier)
static ISound Play(Player player, string name, bool headRelative, WPos pos, float volumeModifier)
{
if (String.IsNullOrEmpty(name))
return null;
@@ -87,16 +87,16 @@ namespace OpenRA
return null;
return soundEngine.Play2D(sounds[name],
false, headRelative, pos.ToFloat2(),
false, headRelative, PPos.FromWPosHackZ(pos).ToFloat2(),
InternalSoundVolume * volumeModifier, true);
}
public static ISound Play(string name) { return Play(null, name, true, PPos.Zero, 1); }
public static ISound Play(string name, PPos pos) { return Play(null, name, false, pos, 1); }
public static ISound Play(string name, float volumeModifier) { return Play(null, name, true, PPos.Zero, volumeModifier); }
public static ISound Play(string name, PPos pos, float volumeModifier) { return Play(null, name, false, pos, volumeModifier); }
public static ISound PlayToPlayer(Player player, string name) { return Play(player, name, true, PPos.Zero, 1); }
public static ISound PlayToPlayer(Player player, string name, PPos pos) { return Play(player, name, false, pos, 1); }
public static ISound Play(string name) { return Play(null, name, true, WPos.Zero, 1); }
public static ISound Play(string name, WPos pos) { return Play(null, name, false, pos, 1); }
public static ISound Play(string name, float volumeModifier) { return Play(null, name, true, WPos.Zero, volumeModifier); }
public static ISound Play(string name, WPos pos, float volumeModifier) { return Play(null, name, false, pos, volumeModifier); }
public static ISound PlayToPlayer(Player player, string name) { return Play(player, name, true, WPos.Zero, 1); }
public static ISound PlayToPlayer(Player player, string name, WPos pos) { return Play(player, name, false, pos, 1); }
public static void PlayVideo(byte[] raw)
{

View File

@@ -80,7 +80,7 @@ namespace OpenRA.Traits
if (targetable == null)
return new []{actor.CenterPosition};
return targetable.TargetableCells(actor).Select(c => c.CenterPosition);
return targetable.TargetablePositions(actor);
}
}

View File

@@ -201,7 +201,7 @@ namespace OpenRA.Traits
public interface ITargetable
{
string[] TargetTypes { get; }
IEnumerable<CPos> TargetableCells(Actor self);
IEnumerable<WPos> TargetablePositions(Actor self);
bool TargetableBy(Actor self, Actor byActor);
}