Convert Waypoints to actors

This commit is contained in:
Paul Chote
2011-02-11 20:32:13 +13:00
parent 4a7be2e0c8
commit b134ba41f4
17 changed files with 114 additions and 146 deletions

View File

@@ -33,8 +33,4 @@ namespace OpenRA.Editor
public ResourceTypeInfo Info; public ResourceTypeInfo Info;
public int Value; public int Value;
} }
class WaypointTemplate
{
}
} }

View File

@@ -416,15 +416,6 @@
this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(139, 6); this.toolStripSeparator4.Size = new System.Drawing.Size(139, 6);
// //
// spawnpointsToolStripMenuItem
//
this.spawnpointsToolStripMenuItem.Enabled = false;
this.spawnpointsToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("spawnpointsToolStripMenuItem.Image")));
this.spawnpointsToolStripMenuItem.Name = "spawnpointsToolStripMenuItem";
this.spawnpointsToolStripMenuItem.Size = new System.Drawing.Size(142, 22);
this.spawnpointsToolStripMenuItem.Text = "&Spawnpoints";
this.spawnpointsToolStripMenuItem.Click += new System.EventHandler(this.SpawnPointsClicked);
//
// toolsToolStripMenuItem // toolsToolStripMenuItem
// //
this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {

View File

@@ -347,7 +347,6 @@ namespace OpenRA.Editor
} }
} }
void SpawnPointsClicked(object sender, EventArgs e) { surface1.SetTool(new WaypointTool(new WaypointTemplate())); }
void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) surface1.IsPanning = true; } void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) surface1.IsPanning = true; }
void Form1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) surface1.IsPanning = false; } void Form1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) surface1.IsPanning = false; }

View File

@@ -156,14 +156,19 @@ namespace OpenRA.Editor
foreach (var p in Players) foreach (var p in Players)
LoadPlayer(file, p, (legacyMapFormat == IniMapFormat.RedAlert)); LoadPlayer(file, p, (legacyMapFormat == IniMapFormat.RedAlert));
var wp = file.GetSection("Waypoints") var wps = file.GetSection("Waypoints")
.Where(kv => int.Parse(kv.Value) > 0) .Where(kv => int.Parse(kv.Value) > 0)
.Select(kv => Pair.New(int.Parse(kv.Key), .Select(kv => Pair.New(int.Parse(kv.Key),
LocationFromMapOffset(int.Parse(kv.Value), MapSize))) LocationFromMapOffset(int.Parse(kv.Value), MapSize)))
.ToArray(); .ToArray();
foreach (var kv in wp) // Add waypoint actors
Map.Waypoints.Add("spawn" + kv.First, kv.Second); foreach( var kv in wps )
{
var a = new ActorReference("mpspawn");
a.Add(new LocationInit(kv.Second));
Map.Actors.Add("spawn" + kv.First, a);
}
} }
static int2 LocationFromMapOffset(int offset, int mapSize) static int2 LocationFromMapOffset(int offset, int mapSize)

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -137,7 +137,6 @@
<Compile Include="Surface.cs"> <Compile Include="Surface.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="WaypointTool.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj"> <ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">

View File

@@ -166,9 +166,6 @@ namespace OpenRA.Editor
} }
} }
var k = Map.Waypoints.FirstOrDefault(a => a.Value == BrushLocation);
if (k.Key != null) Map.Waypoints.Remove(k.Key);
AfterChange(); AfterChange();
} }
@@ -345,12 +342,6 @@ namespace OpenRA.Editor
DrawActor(e.Graphics, ar.Value.Location(), ActorTemplates[ar.Value.Type], DrawActor(e.Graphics, ar.Value.Location(), ActorTemplates[ar.Value.Type],
GetPaletteForActor(ar.Value)); GetPaletteForActor(ar.Value));
foreach (var wp in Map.Waypoints)
e.Graphics.DrawRectangle(Pens.LimeGreen,
TileSet.TileSize * wp.Value.X * Zoom + Offset.X + 4,
TileSet.TileSize * wp.Value.Y * Zoom + Offset.Y + 4,
(TileSet.TileSize - 8) * Zoom, (TileSet.TileSize - 8) * Zoom);
if (Tool != null) if (Tool != null)
Tool.Preview(this, e.Graphics); Tool.Preview(this, e.Graphics);

View File

@@ -1,51 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see LICENSE.
*/
#endregion
using System.Drawing;
using System.Linq;
using SGraphics = System.Drawing.Graphics;
namespace OpenRA.Editor
{
class WaypointTool : ITool
{
WaypointTemplate Waypoint;
public WaypointTool(WaypointTemplate waypoint) { Waypoint = waypoint; }
public void Apply(Surface surface)
{
var k = surface.Map.Waypoints.FirstOrDefault(a => a.Value == surface.GetBrushLocation());
if (k.Key != null) surface.Map.Waypoints.Remove(k.Key);
surface.Map.Waypoints.Add(NextWpid(surface), surface.GetBrushLocation());
}
public void Preview(Surface surface, SGraphics g)
{
g.DrawRectangle(Pens.LimeGreen,
surface.TileSet.TileSize * surface.GetBrushLocation().X * surface.Zoom + surface.GetOffset().X + 4,
surface.TileSet.TileSize * surface.GetBrushLocation().Y * surface.Zoom + surface.GetOffset().Y + 4,
(surface.TileSet.TileSize - 8) * surface.Zoom, (surface.TileSet.TileSize - 8) * surface.Zoom);
}
public string NextWpid(Surface surface)
{
int wpid = 0;
for (; ; )
{
var a = "wp{0}".F(wpid++);
if (!surface.Map.Waypoints.ContainsKey(a))
return a;
}
}
}
}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -102,7 +102,6 @@
<Compile Include="FileFormats\IniFile.cs" /> <Compile Include="FileFormats\IniFile.cs" />
<Compile Include="Graphics\ShpReader.cs" /> <Compile Include="Graphics\ShpReader.cs" />
<Compile Include="Primitives\int2.cs" /> <Compile Include="Primitives\int2.cs" />
<Compile Include="Map\MapStub.cs" />
<Compile Include="Map\SmudgeReference.cs" /> <Compile Include="Map\SmudgeReference.cs" />
<Compile Include="Map\PlayerReference.cs" /> <Compile Include="Map\PlayerReference.cs" />
<Compile Include="Graphics\VqaReader.cs" /> <Compile Include="Graphics\VqaReader.cs" />

View File

@@ -24,7 +24,6 @@ namespace OpenRA
{ {
// Yaml map data // Yaml map data
public Dictionary<string, PlayerReference> Players = new Dictionary<string, PlayerReference>(); public Dictionary<string, PlayerReference> Players = new Dictionary<string, PlayerReference>();
public Dictionary<string, ActorReference> Actors = new Dictionary<string, ActorReference>();
public List<SmudgeReference> Smudges = new List<SmudgeReference>(); public List<SmudgeReference> Smudges = new List<SmudgeReference>();
// Rules overrides // Rules overrides
@@ -94,12 +93,6 @@ namespace OpenRA
if (MapFormat < 4) if (MapFormat < 4)
throw new InvalidDataException("Map format {0} is not supported.\n File: {1}".F(MapFormat, path)); throw new InvalidDataException("Map format {0} is not supported.\n File: {1}".F(MapFormat, path));
// Define RequiresMod for map installer
if (MapFormat < 5)
RequiresMod = Game.CurrentMods.Keys.First();
// Load players // Load players
foreach (var kv in yaml.NodesDict["Players"].NodesDict) foreach (var kv in yaml.NodesDict["Players"].NodesDict)
{ {
@@ -125,7 +118,7 @@ namespace OpenRA
/* hack: make some slots. */ /* hack: make some slots. */
if (!Players.Any(p => p.Value.Playable)) if (!Players.Any(p => p.Value.Playable))
{ {
for (int index = 0; index < Waypoints.Count; index++) for (int index = 0; index < SpawnPoints.Count(); index++)
{ {
var p = new PlayerReference var p = new PlayerReference
{ {
@@ -139,10 +132,6 @@ namespace OpenRA
} }
} }
// Load actors
foreach (var kv in yaml.NodesDict["Actors"].NodesDict)
Actors.Add(kv.Key, new ActorReference(kv.Value.Value, kv.Value.NodesDict));
// Smudges // Smudges
foreach (var kv in yaml.NodesDict["Smudges"].NodesDict) foreach (var kv in yaml.NodesDict["Smudges"].NodesDict)
{ {
@@ -205,7 +194,6 @@ namespace OpenRA
x.Key, x.Key,
x.Value.Save() ) ).ToList() ) ); x.Value.Save() ) ).ToList() ) );
root.Add(new MiniYamlNode("Waypoints", MiniYaml.FromDictionary<string, int2>( Waypoints )));
root.Add(new MiniYamlNode("Smudges", MiniYaml.FromList<SmudgeReference>( Smudges ))); root.Add(new MiniYamlNode("Smudges", MiniYaml.FromList<SmudgeReference>( Smudges )));
root.Add(new MiniYamlNode("Rules", null, Rules)); root.Add(new MiniYamlNode("Rules", null, Rules));
root.Add(new MiniYamlNode("Sequences", null, Sequences)); root.Add(new MiniYamlNode("Sequences", null, Sequences));

View File

@@ -13,8 +13,10 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Security.Cryptography; using System.Security.Cryptography;
using OpenRA.FileFormats;
using OpenRA.Traits;
namespace OpenRA.FileFormats namespace OpenRA
{ {
public class MapStub public class MapStub
{ {
@@ -34,11 +36,10 @@ namespace OpenRA.FileFormats
[FieldLoader.Load] public string Author; [FieldLoader.Load] public string Author;
[FieldLoader.Load] public string Tileset; [FieldLoader.Load] public string Tileset;
[FieldLoader.Load] public string[] StartPoints; public Dictionary<string, ActorReference> Actors = new Dictionary<string, ActorReference>();
public int PlayerCount { get { return StartPoints.Count(); } }
[FieldLoader.LoadUsing( "LoadWaypoints" )] public int PlayerCount { get { return SpawnPoints.Count(); } }
public Dictionary<string, int2> Waypoints = new Dictionary<string, int2>(); public IEnumerable<int2> SpawnPoints { get { return Actors.Values.Where(a => a.Type == "mpspawn").Select(a => a.InitDict.Get<LocationInit>().value); } }
public IEnumerable<int2> SpawnPoints{ get { return Waypoints.Where(kv => StartPoints.Contains(kv.Key)).Select(kv => kv.Value); } }
[FieldLoader.Load] public Rectangle Bounds; [FieldLoader.Load] public Rectangle Bounds;
@@ -50,14 +51,27 @@ namespace OpenRA.FileFormats
Container = FileSystem.OpenPackage(path, int.MaxValue); Container = FileSystem.OpenPackage(path, int.MaxValue);
var yaml = new MiniYaml( null, MiniYaml.FromStream(Container.GetContent("map.yaml")) ); var yaml = new MiniYaml( null, MiniYaml.FromStream(Container.GetContent("map.yaml")) );
FieldLoader.Load(this, yaml); FieldLoader.Load(this, yaml);
Uid = ComputeHash(); Uid = ComputeHash();
// Upgrade maps to define StartPoints // Load actors
foreach (var kv in yaml.NodesDict["Actors"].NodesDict)
Actors.Add(kv.Key, new ActorReference(kv.Value.Value, kv.Value.NodesDict));
// Upgrade map to format 5
if (MapFormat < 5) if (MapFormat < 5)
{ {
// Define RequiresMod for map installer
RequiresMod = Game.CurrentMods.Keys.First();
// Add waypoint actors
foreach( var wp in yaml.NodesDict[ "Waypoints" ].NodesDict )
{
string[] loc = wp.Value.Value.Split( ',' );
var a = new ActorReference("mpspawn");
a.Add(new LocationInit(new int2( int.Parse( loc[ 0 ] ), int.Parse( loc[ 1 ] ) )));
Actors.Add(wp.Key, a);
}
StartPoints = Waypoints.Select(kv => kv.Key).ToArray();
var TopLeft = (int2)FieldLoader.GetValue( "", typeof(int2), yaml.NodesDict["TopLeft"].Value); var TopLeft = (int2)FieldLoader.GetValue( "", typeof(int2), yaml.NodesDict["TopLeft"].Value);
var BottomRight = (int2)FieldLoader.GetValue( "", typeof(int2), yaml.NodesDict["BottomRight"].Value); var BottomRight = (int2)FieldLoader.GetValue( "", typeof(int2), yaml.NodesDict["BottomRight"].Value);
Bounds = Rectangle.FromLTRB(TopLeft.X, TopLeft.Y, BottomRight.X, BottomRight.Y); Bounds = Rectangle.FromLTRB(TopLeft.X, TopLeft.Y, BottomRight.X, BottomRight.Y);
@@ -75,17 +89,5 @@ namespace OpenRA.FileFormats
using (var csp = SHA1.Create()) using (var csp = SHA1.Create())
return new string(csp.ComputeHash(data).SelectMany(a => a.ToString("x2")).ToArray()); return new string(csp.ComputeHash(data).SelectMany(a => a.ToString("x2")).ToArray());
} }
static object LoadWaypoints( MiniYaml y )
{
var ret = new Dictionary<string, int2>();
foreach( var wp in y.NodesDict[ "Waypoints" ].NodesDict )
{
string[] loc = wp.Value.Value.Split( ',' );
ret.Add( wp.Key, new int2( int.Parse( loc[ 0 ] ), int.Parse( loc[ 1 ] ) ) );
}
return ret;
}
} }
} }

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -183,6 +183,8 @@
<Compile Include="Network\Handshake.cs" /> <Compile Include="Network\Handshake.cs" />
<Compile Include="Widgets\ProgressBarWidget.cs" /> <Compile Include="Widgets\ProgressBarWidget.cs" />
<Compile Include="Utilities.cs" /> <Compile Include="Utilities.cs" />
<Compile Include="Traits\Waypoint.cs" />
<Compile Include="MapStub.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj"> <ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">

View File

@@ -0,0 +1,36 @@
#region Copyright & License Information
/*
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see LICENSE.
*/
#endregion
using System.Collections.Generic;
using OpenRA.FileFormats;
namespace OpenRA.Traits
{
class WaypointInfo : ITraitInfo
{
public object Create( ActorInitializer init ) { return new Waypoint( init ); }
}
class Waypoint : IOccupySpace, ISync
{
[Sync]
int2 location;
public Waypoint(ActorInitializer init)
{
this.location = init.Get<LocationInit,int2>();
}
public int2 TopLeft { get { return location; } }
public IEnumerable<Pair<int2, SubCell>> OccupiedCells() { yield break; }
public int2 PxPosition { get { return Util.CenterOfCell( location ); } }
}
}

View File

@@ -48,17 +48,16 @@ namespace OpenRA.Mods.RA
if (ticks == 0) if (ticks == 0)
{ {
var w = Map.Waypoints; LoopTrack(Actors["boat1"], Actors["tl1"].Location, Actors["tr1"].Location);
LoopTrack(Actors["boat1"], w["tl1"], w["tr1"]); LoopTrack(Actors["boat3"], Actors["tl1"].Location, Actors["tr1"].Location);
LoopTrack(Actors["boat3"], w["tl1"], w["tr1"]); LoopTrack(Actors["boat2"], Actors["tl3"].Location, Actors["tr3"].Location);
LoopTrack(Actors["boat2"], w["tl3"], w["tr3"]); LoopTrack(Actors["boat4"], Actors["tl3"].Location, Actors["tr3"].Location);
LoopTrack(Actors["boat4"], w["tl3"], w["tr3"]);
CreateUnitsInTransport(Actors["lst1"], new string[] {"htnk"}); CreateUnitsInTransport(Actors["lst1"], new string[] {"htnk"});
CreateUnitsInTransport(Actors["lst2"], new string[] {"mcv"}); CreateUnitsInTransport(Actors["lst2"], new string[] {"mcv"});
CreateUnitsInTransport(Actors["lst3"], new string[] {"htnk"}); CreateUnitsInTransport(Actors["lst3"], new string[] {"htnk"});
LoopTrack(Actors["lst1"], w["tl2"], w["tr2"]); LoopTrack(Actors["lst1"], Actors["tl2"].Location, Actors["tr2"].Location);
LoopTrack(Actors["lst2"], w["tl2"], w["tr2"]); LoopTrack(Actors["lst2"], Actors["tl2"].Location, Actors["tr2"].Location);
LoopTrack(Actors["lst3"], w["tl2"], w["tr2"]); LoopTrack(Actors["lst3"], Actors["tl2"].Location, Actors["tr2"].Location);
} }
ticks++; ticks++;

View File

@@ -97,12 +97,12 @@ namespace OpenRA.Mods.Cnc
{ {
new OwnerInit( Players["BadGuy"] ), new OwnerInit( Players["BadGuy"] ),
new FacingInit( 0 ), new FacingInit( 0 ),
new LocationInit ( Map.Waypoints["nod0"] ), new LocationInit ( Actors["nod0"].Location ),
}); });
var mobile = a.Trait<Mobile>(); var mobile = a.Trait<Mobile>();
a.QueueActivity( mobile.MoveTo( Map.Waypoints["nod1"], 2 ) ); a.QueueActivity( mobile.MoveTo( Actors["nod1"].Location, 2 ) );
a.QueueActivity( mobile.MoveTo( Map.Waypoints["nod2"], 2 ) ); a.QueueActivity( mobile.MoveTo( Actors["nod2"].Location, 2 ) );
a.QueueActivity( mobile.MoveTo( Map.Waypoints["nod3"], 2 ) ); a.QueueActivity( mobile.MoveTo( Actors["nod3"].Location, 2 ) );
// Todo: Queue hunt order // Todo: Queue hunt order
} }
}); });
@@ -127,8 +127,8 @@ namespace OpenRA.Mods.Cnc
if (ticks == 25*5) if (ticks == 25*5)
{ {
ReinforceFromSea(self.World, ReinforceFromSea(self.World,
Map.Waypoints["lstStart"], Actors["lstStart"].Location,
Map.Waypoints["lstEnd"], Actors["lstEnd"].Location,
new int2(53,53), new int2(53,53),
new string[] {"e1","e1","e1"}); new string[] {"e1","e1","e1"});
} }
@@ -136,8 +136,8 @@ namespace OpenRA.Mods.Cnc
if (ticks == 25*15) if (ticks == 25*15)
{ {
ReinforceFromSea(self.World, ReinforceFromSea(self.World,
Map.Waypoints["lstStart"], Actors["lstStart"].Location,
Map.Waypoints["lstEnd"], Actors["lstEnd"].Location,
new int2(53,53), new int2(53,53),
new string[] {"e1","e1","e1"}); new string[] {"e1","e1","e1"});
} }
@@ -145,8 +145,8 @@ namespace OpenRA.Mods.Cnc
if (ticks == 25*30) if (ticks == 25*30)
{ {
ReinforceFromSea(self.World, ReinforceFromSea(self.World,
Map.Waypoints["lstStart"], Actors["lstStart"].Location,
Map.Waypoints["lstEnd"], Actors["lstEnd"].Location,
new int2(53,53), new int2(53,53),
new string[] {"jeep"}); new string[] {"jeep"});
} }
@@ -154,8 +154,8 @@ namespace OpenRA.Mods.Cnc
if (ticks == 25*60) if (ticks == 25*60)
{ {
ReinforceFromSea(self.World, ReinforceFromSea(self.World,
Map.Waypoints["lstStart"], Actors["lstStart"].Location,
Map.Waypoints["lstEnd"], Actors["lstEnd"].Location,
new int2(53,53), new int2(53,53),
new string[] {"jeep"}); new string[] {"jeep"});
} }
@@ -167,8 +167,8 @@ namespace OpenRA.Mods.Cnc
{ {
var self = Actors[ "Gunboat" ]; var self = Actors[ "Gunboat" ];
var mobile = self.Trait<Mobile>(); var mobile = self.Trait<Mobile>();
self.QueueActivity(mobile.ScriptedMove( Map.Waypoints["gunboatLeft"] )); self.QueueActivity(mobile.ScriptedMove( Actors["gunboatLeft"].Location ));
self.QueueActivity(mobile.ScriptedMove( Map.Waypoints["gunboatRight"] )); self.QueueActivity(mobile.ScriptedMove( Actors["gunboatRight"].Location ));
self.QueueActivity(new CallFunc(() => SetGunboatPath())); self.QueueActivity(new CallFunc(() => SetGunboatPath()));
} }

View File

@@ -58,8 +58,8 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|| orderManager.LocalClient.State == Session.ClientState.Ready) || orderManager.LocalClient.State == Session.ClientState.Ready)
return false; return false;
var p = map.Waypoints var p = map.SpawnPoints
.Select((sp, i) => Pair.New(mapPreview.ConvertToPreview(map, sp.Value), i)) .Select((sp, i) => Pair.New(mapPreview.ConvertToPreview(map, sp), i))
.Where(a => (a.First - mi.Location).LengthSquared < 64) .Where(a => (a.First - mi.Location).LengthSquared < 64)
.Select(a => a.Second + 1) .Select(a => a.Second + 1)
.FirstOrDefault(); .FirstOrDefault();

View File

@@ -193,3 +193,9 @@ CRATE:
BelowUnits: BelowUnits:
ProximityCaptor: ProximityCaptor:
Types:Crate Types:Crate
mpspawn:
Waypoint:
waypoint:
Waypoint:

View File

@@ -329,3 +329,9 @@ powerproxy.sonarpulse:
OneShot: yes OneShot: yes
EndChargeSound: pulse1.aud EndChargeSound: pulse1.aud
SelectTargetSound: slcttgt1.aud SelectTargetSound: slcttgt1.aud
mpspawn:
Waypoint:
waypoint:
Waypoint: