Remove World.FrameNumber.
This commit is contained in:
@@ -518,8 +518,7 @@ namespace OpenRA
|
||||
return null;
|
||||
}
|
||||
|
||||
var world = Game.orderManager.world;
|
||||
int currFrame = world != null ? world.FrameNumber : 0;
|
||||
var currFrame = Game.orderManager.LocalFrameNumber;
|
||||
float atten = 1f;
|
||||
|
||||
// Check if max # of instances-per-location reached:
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace OpenRA.Traits
|
||||
|
||||
void Invalidate()
|
||||
{
|
||||
Hash = Sync.hash_player(self.Owner) + self.World.FrameNumber * 3;
|
||||
Hash = Sync.hash_player(self.Owner) + self.World.WorldTick * 3;
|
||||
}
|
||||
|
||||
static IEnumerable<CPos> FindVisibleTiles(World world, CPos position, WRange radius)
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace OpenRA
|
||||
List<IEffect> effects = new List<IEffect>();
|
||||
Queue<Action<World>> frameEndActions = new Queue<Action<World>>();
|
||||
|
||||
public int FrameNumber { get { return orderManager.LocalFrameNumber; } }
|
||||
public int Timestep;
|
||||
|
||||
internal readonly OrderManager orderManager;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
var shellmapDecorations = widget.Get("SHELLMAP_DECORATIONS");
|
||||
shellmapDecorations.IsVisible = () => menuType != MenuType.None && Game.Settings.Game.ShowShellmap;
|
||||
shellmapDecorations.Get<ImageWidget>("RECBLOCK").IsVisible = () => world.FrameNumber / 25 % 2 == 0;
|
||||
shellmapDecorations.Get<ImageWidget>("RECBLOCK").IsVisible = () => world.WorldTick / 25 % 2 == 0;
|
||||
|
||||
var shellmapDisabledDecorations = widget.Get("SHELLMAP_DISABLED_DECORATIONS");
|
||||
shellmapDisabledDecorations.IsVisible = () => !Game.Settings.Game.ShowShellmap;
|
||||
|
||||
@@ -34,10 +34,10 @@ namespace OpenRA.Mods.RA.Activities
|
||||
{
|
||||
// Maybe we lost the owner-linked refinery:
|
||||
harv.OwnerLinkedProc = null;
|
||||
if (self.World.FrameNumber - chosenTicks > NextChooseTime)
|
||||
if (self.World.WorldTick - chosenTicks > NextChooseTime)
|
||||
{
|
||||
harv.ChooseNewProc(self, null);
|
||||
chosenTicks = self.World.FrameNumber;
|
||||
chosenTicks = self.World.WorldTick;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -49,8 +49,8 @@ namespace OpenRA.Mods.RA.Move
|
||||
var cached = CachedPaths.FirstOrDefault(p => p.from == from && p.to == target && p.actor == self);
|
||||
if (cached != null)
|
||||
{
|
||||
Log.Write("debug", "Actor {0} asked for a path from {1} tick(s) ago", self.ActorID, world.FrameNumber - cached.tick);
|
||||
if (world.FrameNumber - cached.tick > MaxPathAge)
|
||||
Log.Write("debug", "Actor {0} asked for a path from {1} tick(s) ago", self.ActorID, world.WorldTick - cached.tick);
|
||||
if (world.WorldTick - cached.tick > MaxPathAge)
|
||||
CachedPaths.Remove(cached);
|
||||
return new List<CPos>(cached.result);
|
||||
}
|
||||
@@ -73,8 +73,8 @@ namespace OpenRA.Mods.RA.Move
|
||||
|
||||
CheckSanePath2(pb, from, target);
|
||||
|
||||
CachedPaths.RemoveAll(p => world.FrameNumber - p.tick > MaxPathAge);
|
||||
CachedPaths.Add(new CachedPath { from = from, to = target, actor = self, result = pb, tick = world.FrameNumber });
|
||||
CachedPaths.RemoveAll(p => world.WorldTick - p.tick > MaxPathAge);
|
||||
CachedPaths.Add(new CachedPath { from = from, to = target, actor = self, result = pb, tick = world.WorldTick });
|
||||
return new List<CPos>(pb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.RA
|
||||
if (e.Attacker.Owner.IsAlliedWith(self.Owner) && e.Damage <= 0)
|
||||
return;
|
||||
|
||||
if (self.World.FrameNumber - lastAttackTime > info.NotifyInterval * 25)
|
||||
if (self.World.WorldTick - lastAttackTime > info.NotifyInterval * 25)
|
||||
{
|
||||
Sound.PlayNotification(self.Owner, "Speech", "BaseAttack", self.Owner.Country.Race);
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace OpenRA.Mods.RA
|
||||
radarPings.Add(() => self.Owner == self.World.LocalPlayer, self.CenterPosition, info.RadarPingColor, info.RadarPingDuration);
|
||||
}
|
||||
|
||||
lastAttackTime = self.World.FrameNumber;
|
||||
lastAttackTime = self.World.WorldTick;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace OpenRA.Mods.RA
|
||||
if (e.Attacker != null && e.Attacker.Owner == self.Owner)
|
||||
return;
|
||||
|
||||
if (self.World.FrameNumber - lastAttackTime > info.NotifyInterval * 25)
|
||||
if (self.World.WorldTick - lastAttackTime > info.NotifyInterval * 25)
|
||||
{
|
||||
Sound.PlayNotification(self.Owner, "Speech", "HarvesterAttack", self.Owner.Country.Race);
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace OpenRA.Mods.RA
|
||||
radarPings.Add(() => self.Owner == self.World.LocalPlayer, self.CenterPosition, info.RadarPingColor, info.RadarPingDuration);
|
||||
}
|
||||
|
||||
lastAttackTime = self.World.FrameNumber;
|
||||
lastAttackTime = self.World.WorldTick;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,9 +73,9 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
if (self.World.FrameNumber % 1500 == 1)
|
||||
if (self.World.WorldTick % 1500 == 1)
|
||||
UpdateEarnedThisMinute();
|
||||
if (self.World.FrameNumber % 250 == 0)
|
||||
if (self.World.WorldTick % 250 == 0)
|
||||
UpdateMapControl();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,14 +40,14 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
if (!Panicking)
|
||||
Self.CancelActivity();
|
||||
PanicStartedTick = Self.World.FrameNumber;
|
||||
PanicStartedTick = Self.World.WorldTick;
|
||||
}
|
||||
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
if (!Panicking) return;
|
||||
|
||||
if (self.World.FrameNumber >= PanicStartedTick + Info.PanicLength)
|
||||
if (self.World.WorldTick >= PanicStartedTick + Info.PanicLength)
|
||||
{
|
||||
self.CancelActivity();
|
||||
PanicStartedTick = 0;
|
||||
|
||||
@@ -291,7 +291,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
statusCheckbox.IsHighlighted = () => !statusCheckbox.IsChecked() &&
|
||||
orderManager.LobbyInfo.FirstEmptySlot() == null &&
|
||||
world.FrameNumber / 25 % 2 == 0;
|
||||
orderManager.LocalFrameNumber / 25 % 2 == 0;
|
||||
}
|
||||
|
||||
// Options panel
|
||||
|
||||
@@ -285,12 +285,12 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
string AverageOrdersPerMinute(double orders)
|
||||
{
|
||||
return (world.FrameNumber == 0 ? 0 : orders / (world.FrameNumber / 1500.0)).ToString("F1");
|
||||
return (world.WorldTick == 0 ? 0 : orders / (world.WorldTick / 1500.0)).ToString("F1");
|
||||
}
|
||||
|
||||
string AverageEarnedPerMinute(double earned)
|
||||
{
|
||||
return "$" + (world.FrameNumber == 0 ? 0 : earned / (world.FrameNumber / 1500.0)).ToString("F2");
|
||||
return "$" + (world.WorldTick == 0 ? 0 : earned / (world.WorldTick / 1500.0)).ToString("F2");
|
||||
}
|
||||
|
||||
static Color GetPowerColor(PowerState state)
|
||||
|
||||
@@ -56,8 +56,8 @@ namespace OpenRA.Mods.RA
|
||||
return;
|
||||
|
||||
var qr = Game.Renderer.WorldQuadRenderer;
|
||||
var doDim = refreshTick - world.FrameNumber <= 0;
|
||||
if (doDim) refreshTick = world.FrameNumber + 20;
|
||||
var doDim = refreshTick - world.WorldTick <= 0;
|
||||
if (doDim) refreshTick = world.WorldTick + 20;
|
||||
|
||||
var viewBounds = wr.Viewport.CellBounds;
|
||||
foreach (var pair in layers)
|
||||
|
||||
Reference in New Issue
Block a user