Refactor per-player shrouds & fix shellmap shroud.
This commit is contained in:
@@ -160,7 +160,8 @@ namespace OpenRA.Mods.RA.Effects
|
||||
var altitude = float2.Lerp(Args.srcAltitude, Args.destAltitude, at);
|
||||
var pos = float2.Lerp(Args.src.ToFloat2(), Args.dest.ToFloat2(), at) - new float2(0, altitude);
|
||||
|
||||
if (Args.firedBy.World.RenderedShroud.IsVisible(((PPos) pos.ToInt2()).ToCPos()))
|
||||
var cell = ((PPos)pos.ToInt2()).ToCPos();
|
||||
if (!Args.firedBy.World.FogObscures(cell))
|
||||
{
|
||||
if (Info.High || Info.Angle > 0)
|
||||
{
|
||||
|
||||
@@ -93,8 +93,8 @@ namespace OpenRA.Mods.RA
|
||||
var conPos = WPos.Average(positions[i], positions[i-1], positions[i-2], positions[i-3]);
|
||||
var nextPos = WPos.Average(positions[i-1], positions[i-2], positions[i-3], positions[i-4]);
|
||||
|
||||
if (self.World.RenderedShroud.IsVisible(new CPos(conPos)) ||
|
||||
self.World.RenderedShroud.IsVisible(new CPos(nextPos)))
|
||||
if (!self.World.FogObscures(new CPos(conPos)) &&
|
||||
!self.World.FogObscures(new CPos(nextPos)))
|
||||
{
|
||||
Game.Renderer.WorldLineRenderer.DrawLine(wr.ScreenPosition(conPos), wr.ScreenPosition(nextPos), trailStart, trailEnd);
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
}
|
||||
|
||||
var hasGps = (watcher != null && (watcher.Granted || watcher.GrantedAllies));
|
||||
var hasDot = (huf != null && !huf.IsVisible(self.World.RenderedShroud, self)); // WRONG (why?)
|
||||
var hasDot = (huf != null && !huf.IsVisible(self, self.World.RenderPlayer));
|
||||
var dotHidden = (cloak != null && cloak.Cloaked) || (spy != null && spy.Disguised);
|
||||
|
||||
show = hasGps && hasDot && !dotHidden;
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
|
||||
public IEnumerable<Renderable> Render(WorldRenderer wr)
|
||||
{
|
||||
if (Args.firedBy.World.RenderedShroud.IsVisible(PxPosition.ToCPos()))
|
||||
if (!Args.firedBy.World.FogObscures(PxPosition.ToCPos()))
|
||||
yield return new Renderable(anim.Image, PxPosition.ToFloat2() - 0.5f * anim.Image.size - new float2(0, Altitude),
|
||||
wr.Palette(Args.weapon.Underwater ? "shadow" : "effect"), PxPosition.Y);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user