some refs to "Game.world" i missed a while ago.
This commit is contained in:
@@ -210,7 +210,7 @@ namespace OpenRa
|
||||
world.CreateActor("mcv", sp, world.players[client.Index]);
|
||||
}
|
||||
|
||||
Game.viewport.GoToStartLocation();
|
||||
Game.viewport.GoToStartLocation( Game.world.LocalPlayer );
|
||||
orderManager.StartGame();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRa.GameRules
|
||||
public Cache<string, List<Actor>> GatherBuildings( Player player )
|
||||
{
|
||||
var ret = new Cache<string, List<Actor>>( x => new List<Actor>() );
|
||||
foreach( var b in Game.world.Actors.Where( x => x.Owner == player && x.Info.Traits.Contains<BuildingInfo>() ) )
|
||||
foreach( var b in player.World.Actors.Where( x => x.Owner == player && x.Info.Traits.Contains<BuildingInfo>() ) )
|
||||
{
|
||||
ret[ b.Info.Name ].Add( b );
|
||||
var buildable = b.Info.Traits.GetOrDefault<BuildableInfo>();
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace OpenRa.Graphics
|
||||
|
||||
mapOnlySheet.Texture.SetData(oreLayer);
|
||||
|
||||
if (!world.Actors.Any(a => a.Owner == Game.world.LocalPlayer && a.traits.Contains<ProvidesRadar>()))
|
||||
if (!world.Actors.Any(a => a.Owner == world.LocalPlayer && a.traits.Contains<ProvidesRadar>()))
|
||||
return;
|
||||
|
||||
var bitmap = new Bitmap(oreLayer);
|
||||
@@ -109,7 +109,7 @@ namespace OpenRa.Graphics
|
||||
{
|
||||
for (var y = 0; y < 128; y++)
|
||||
for (var x = 0; x < 128; x++)
|
||||
if (!Game.world.LocalPlayer.Shroud.DisplayOnRadar(x, y))
|
||||
if (!world.LocalPlayer.Shroud.DisplayOnRadar(x, y))
|
||||
*(c + (y * bitmapData.Stride >> 2) + x) = shroudColor.ToArgb();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRa.Graphics
|
||||
|
||||
public void DrawRegions( World world )
|
||||
{
|
||||
Game.world.WorldRenderer.palette.Update(Game.world.Actors.SelectMany(
|
||||
world.WorldRenderer.palette.Update(world.Actors.SelectMany(
|
||||
a => a.traits.WithInterface<IPaletteModifier>()));
|
||||
|
||||
float2 r1 = new float2(2, -2) / screenSize;
|
||||
@@ -54,7 +54,7 @@ namespace OpenRa.Graphics
|
||||
|
||||
if( Game.orderManager.GameStarted )
|
||||
{
|
||||
Game.world.WorldRenderer.Draw();
|
||||
world.WorldRenderer.Draw();
|
||||
Game.chrome.Draw( world );
|
||||
|
||||
if (Game.orderManager.IsNetplay &&
|
||||
@@ -130,9 +130,9 @@ namespace OpenRa.Graphics
|
||||
scrollPosition = (avgPos - .5f * new float2(Width, Height)).ToInt2();
|
||||
}
|
||||
|
||||
public void GoToStartLocation()
|
||||
public void GoToStartLocation( Player player )
|
||||
{
|
||||
Center(Game.world.Actors.Where(a => a.Owner == Game.world.LocalPlayer && a.traits.Contains<Selectable>()));
|
||||
Center(player.World.Actors.Where(a => a.Owner == player && a.traits.Contains<Selectable>()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRa
|
||||
set
|
||||
{
|
||||
localPlayerIndex = value.Index;
|
||||
Game.viewport.GoToStartLocation();
|
||||
Game.viewport.GoToStartLocation( value );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user