Skip to content

Instantly share code, notes, and snippets.

class ParadropOrderTargeter : IOrderTargeter
{
public bool CanTarget(Actor self, Target target, List<Actor> othersAtTarget, TargetModifiers modifiers, ref string cursor)
{
if (target.Type != TargetType.Terrain)
return false;
var location = self.World.Map.CellContaining(target.CenterPosition);
if (!self.World.Map.Contains(location))
return false;
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Primitives;
using OpenRA.Traits;
using OpenRA.Mods.RA.Buildings;
using OpenRA.Mods.RA.Render;
using OpenRA.Graphics;
namespace OpenRA.Mods.RA
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString == "Move")
{
if (Info.MovesToShroud && self.Owner.Shroud.IsExplored(order.TargetLocation))
PerformMove(self, self.World.Map.Clamp(order.TargetLocation),
order.Queued && !self.IsIdle);
}
if (order.OrderString == "Stop")
#region Copyright & License Information
/*
* Copyright 2007-2014 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 COPYING.
*/
#endregion
@phrohdoh
phrohdoh / lg2s.cs
Created September 19, 2014 20:25
libgit2sharp troubles
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using LibGit2Sharp;
namespace GitSharp
{
class MainClass
{
public DebugGridToolsLogic(Widget widget, World world)
{
var gridTrait = world.WorldActor.Trait<CellGridDebugOverlay>();
var btnToggleVisibility = widget.GetOrNull<ButtonWidget>("TOGGLE_GRID");
if (btnToggleVisibility != null)
btnToggleVisibility.OnClick = () => gridTrait.Visible ^= true;
var btnCycleRenderOrder = widget.GetOrNull<ButtonWidget>("TOGGLE_RENDER_ORDER");
if (btnCycleRenderOrder != null)
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "openra"]
url = git@github.com:OpenRA/OpenRA.git
fetch = +refs/heads/*:refs/remotes/openra/*
#region Copyright & License Information
/*
* Copyright 2007-2014 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 COPYING.
*/
#endregion
diff --git a/OpenRA.Mods.RA/UnitUpgradeManager.cs b/OpenRA.Mods.RA/UnitUpgradeManager.cs
index 7bc9fdb..23d0e4e 100644
--- a/OpenRA.Mods.RA/UnitUpgradeManager.cs
+++ b/OpenRA.Mods.RA/UnitUpgradeManager.cs
@@ -45,7 +45,10 @@ public void GrantUpgrade(Actor self, string upgrade)
{
foreach (var up in upgradable.Value)
if (up.AcceptsUpgrade(upgrade))
+ {
up.UpgradeAvailable(self, upgrade, true);
$ mono --debug SDL2TestGame.exe
Mono: Assembly Loader probing location: '/Library/Frameworks/Mono.framework/Versions/3.8.0/lib/mono/4.5/mscorlib.dll'.
Mono: Image addref mscorlib[0x7a620d30] -> /Library/Frameworks/Mono.framework/Versions/3.8.0/lib/mono/4.5/mscorlib.dll[0x7aa21a00]: 2
Mono: Assembly Loader probing location: '/Library/Frameworks/Mono.framework/Versions/3.8.0/lib/mono/4.5/mscorlib.dll'.
Mono: AOT loaded AOT Module for /Library/Frameworks/Mono.framework/Versions/3.8.0/lib/mono/4.5/mscorlib.dll.
Mono: Assembly Loader loaded assembly from location: '/Library/Frameworks/Mono.framework/Versions/3.8.0/lib/mono/4.5/mscorlib.dll'.
Mono: Config attempting to parse: '/Library/Frameworks/Mono.framework/Versions/3.8.0/lib/mono/4.5/mscorlib.dll.config'.
Mono: Config attempting to parse: '/Library/Frameworks/Mono.framework/Versions/3.8.0/etc/mono/assemblies/mscorlib/mscorlib.config'.