Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Cn-mjt44 committed Nov 24, 2022
1 parent c31b4e9 commit 2b352a0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion RW_NodeTree/CompChildNodeProccesser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public HashSet<string> RegiestedNodeId
Log.Error(ex.ToString());
}
}
cache.RemoveWhere(x => !x.IsVaildityKeyFormat());
regiestedNodeId.AddRange(cache);
}
return new HashSet<string>(regiestedNodeId);
Expand Down Expand Up @@ -533,7 +534,7 @@ public Material GetAndUpdateChildTexture(Rot4 rot, Graphic subGraphic = null)
List<RenderInfo> final = new List<RenderInfo>();
foreach((Thing, string, List<RenderInfo>) infos in nodeRenderingInfos)
{
final.AddRange(infos.Item3);
if(!infos.Item3.NullOrEmpty()) final.AddRange(infos.Item3);
}

RenderingTools.RenderToTarget(final, ref cachedRenderTarget, ref texture, default(Vector2Int), Props.TextureSizeFactor, Props.ExceedanceFactor, Props.ExceedanceOffset);
Expand Down
2 changes: 1 addition & 1 deletion RW_NodeTree/Patch/Pawn_EquipmentTracker_Patcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ IEnumerable<Gizmo> forEach(IEnumerable< Gizmo> result)
{
Log.Error(ex.ToString());
}
foreach (Gizmo gizmo in gizmos) yield return gizmo;
foreach (Gizmo gizmo in gizmos) if(gizmo != null) yield return gizmo;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion RW_NodeTree/Patch/Pawn_TryGetAttackVerb_Patcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void PrePawn_TryGetAttackVerb(Pawn __instance)
if(job != null && typeof(JobDriver_AttackStatic).IsAssignableFrom(job.def.driverClass) && job.verbToUse?.Caster == __instance)
{
CompEquippable equippable = __instance.equipment.PrimaryEq;
List<Verb> verbList = CompChildNodeProccesser.GetOriginalAllVerbs(equippable.verbTracker);
List<Verb> verbList = CompChildNodeProccesser.GetOriginalAllVerbs(equippable.VerbTracker);
if (verbList.Remove(__instance.CurJob.verbToUse))
{
verbList.Insert(0, __instance.CurJob.verbToUse);
Expand Down
3 changes: 2 additions & 1 deletion RW_NodeTree/Patch/VerbTracker_AllVerbs_Patcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ internal List<Verb> PostVerbTracker_AllVerbs(Type ownerType, List<Verb> result)
{
for (int i = 0; i < result.Count; i++)
{
result[i] = GetAfterConvertVerbCorrespondingThing(ownerType, result[i]).Item2;
result[i] = GetAfterConvertVerbCorrespondingThing(ownerType, result[i]).Item2 ?? result[i];
}
result.RemoveAll(x => x == null || x.verbProps == null);
return result;
}
return null;
Expand Down
7 changes: 4 additions & 3 deletions RW_NodeTree/VerbRegiestInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using RW_NodeTree.Tools;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -16,7 +17,7 @@ public VerbToolRegiestInfo(string id, Tool berforConvertTool, Tool afterCobvertT
this.afterCobvertTool = afterCobvertTool;
}

public bool Vaildity => berforConvertTool != null && afterCobvertTool != null;
public bool Vaildity => berforConvertTool != null && afterCobvertTool != null && (id == null || id.IsVaildityKeyFormat());

public override string ToString()
{
Expand All @@ -35,7 +36,7 @@ public VerbPropertiesRegiestInfo(string id, VerbProperties berforConvertProperti
this.berforConvertProperties = berforConvertProperties;
this.afterConvertProperties = afterConvertProperties;
}
public bool Vaildity => berforConvertProperties != null && afterConvertProperties != null;
public bool Vaildity => berforConvertProperties != null && afterConvertProperties != null && (id == null || id.IsVaildityKeyFormat());

public override string ToString()
{
Expand Down

0 comments on commit 2b352a0

Please sign in to comment.