Fix cnc AFLD

This commit is contained in:
Paul Chote
2010-03-25 14:00:25 +13:00
parent dba4859e9a
commit 08f7d58c86
2 changed files with 5 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -34,16 +34,15 @@ namespace OpenRA.Traits
foreach (var a in self.World.Actors)
{
if (a.Location.X >= self.World.Map.MapSize
|| a.Location.Y >= self.World.Map.MapSize)
if (!self.World.Map.IsInMap(a.Location))
continue;
var bounds = a.GetBounds(true);
var i1 = (int)bounds.Left / scale;
var i2 = (int)bounds.Right / scale;
var j1 = (int)bounds.Top / scale;
var j2 = (int)bounds.Bottom / scale;
for (var j = j1; j <= j2; j++)
for (var i = i1; i <= i2; i++)
bins[i, j].Add(a);

View File

@@ -48,6 +48,7 @@ namespace OpenRA.Mods.Cnc
{
var a = w.CreateActor("C17", startPos, owner);
var cargo = a.traits.Get<Cargo>();
a.traits.Get<Unit>().Facing = 64;
var newUnit = new Actor(self.World, producee.Name, new int2(0, 0), self.Owner);
cargo.Load(a, newUnit);