pre-explore a little bit around the mcv at start

This commit is contained in:
Chris Forbes
2010-03-30 18:26:52 +13:00
parent ef761abd94
commit a71ba665a7
2 changed files with 18 additions and 1 deletions

View File

@@ -25,7 +25,10 @@ using OpenRA.FileFormats;
namespace OpenRA.Traits
{
class SpawnDefaultUnitsInfo : StatelessTraitInfo<SpawnDefaultUnits> { }
class SpawnDefaultUnitsInfo : StatelessTraitInfo<SpawnDefaultUnits>
{
public readonly int InitialExploreRange = 5;
}
class SpawnDefaultUnits : IGameStarted
{
@@ -48,6 +51,10 @@ namespace OpenRA.Traits
void SpawnUnitsForPlayer(Player p, int2 sp)
{
p.World.CreateActor("mcv", sp, p);
if (p == p.World.LocalPlayer)
p.World.WorldActor.traits.Get<Shroud>().Explore( p.World, sp,
p.World.WorldActor.Info.Traits.Get<SpawnDefaultUnitsInfo>().InitialExploreRange);
}
static int2 ChooseSpawnPoint(World world, List<int2> available, List<int2> taken)