Skip to content

Commit

Permalink
Fixed error drawing ghost area when selecting a window blueprint.
Browse files Browse the repository at this point in the history
  • Loading branch information
João Pedro Torres committed May 21, 2021
1 parent 72b7455 commit aa114da
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Binary file modified 1.1/Assemblies/OpenTheWindows.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Source/OpenTheWindows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<OutputPath>..\1.1\Assemblies\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>none</ErrorReport>
<WarningLevel>4</WarningLevel>
<WarningLevel>0</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
Expand Down
12 changes: 8 additions & 4 deletions Source/PlaceWorker_Window.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Linq;
using RimWorld;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Verse;

Expand All @@ -8,18 +10,20 @@ public class PlaceWorker_Window : PlaceWorker
{
public override void DrawGhost(ThingDef def, IntVec3 center, Rot4 rot, Color ghostCol, Thing thing = null)
{
if (thing == null)
List<IntVec3> field;
if (thing == null || thing is Blueprint)
{
Map currentMap = Find.CurrentMap;
IntVec3 start = WindowUtility.FindEnd(center, rot, def.size, false);
IntVec3 end = WindowUtility.FindEnd(center, rot, def.size, true);
GenDraw.DrawFieldEdges(WindowUtility.GetWindowObfuscation(def.size, center, rot, currentMap, start, end).ToList());
field = WindowUtility.GetWindowObfuscation(def.size, center, rot, currentMap, start, end).ToList();
}
else
{
var window = thing as Building_Window;
GenDraw.DrawFieldEdges(window.EffectArea);
field = window.EffectArea;
}
GenDraw.DrawFieldEdges(field);
}
}
}
2 changes: 1 addition & 1 deletion Source/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0")]
[assembly: AssemblyFileVersion("2.2.2")]
[assembly: AssemblyFileVersion("2.3")]

0 comments on commit aa114da

Please sign in to comment.