server stuff

This commit is contained in:
Chris Forbes
2009-11-30 21:18:50 +13:00
parent fa02e9d45c
commit 2913c3310d
7 changed files with 163 additions and 50 deletions

View File

@@ -103,6 +103,7 @@ namespace OpenRa.Game.GameRules
public readonly int Storage = 0;
public readonly bool Unsellable = false;
public readonly int[] RallyPoint = { 1, 3 };
public readonly float[] SpawnOffset = null;
public BuildingInfo(string name) : base(name) { }
}

View File

@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
using IjwFramework.Types;
using System.Linq;
using System.Net.Sockets;
using System.Threading;

View File

@@ -34,13 +34,18 @@ namespace OpenRa.Game.Traits
{
var mobile = newUnit.traits.GetOrDefault<Mobile>();
if( mobile != null )
newUnit.QueueActivity( new Traits.Activities.Move( rp.rallyPoint, 1 ) );
newUnit.QueueActivity( new Activities.Move( rp.rallyPoint, 1 ) );
var heli = newUnit.traits.GetOrDefault<Helicopter>();
if( heli != null )
if (heli != null)
heli.targetLocation = rp.rallyPoint; // TODO: make Activity.Move work for helis.
}
var bi = self.unitInfo as BuildingInfo;
if (bi != null && bi.SpawnOffset != null)
newUnit.CenterLocation = self.CenterLocation
+ new float2(bi.SpawnOffset[0], bi.SpawnOffset[1]);
Game.world.Add( newUnit );
if( self.traits.Contains<RenderWarFactory>() )