diff --git a/About/About.xml b/About/About.xml index 79ce445..7a910e9 100644 --- a/About/About.xml +++ b/About/About.xml @@ -2,7 +2,7 @@ Dismiss Trader Mehni - 0.18.0 + 1.0.0 Dismiss traders with the click of a button. https://ludeon.com/forums/index.php?topic=35832.0 \ No newline at end of file diff --git a/Assemblies/0Harmony.dll b/Assemblies/0Harmony.dll index 904f049..488b2ff 100644 Binary files a/Assemblies/0Harmony.dll and b/Assemblies/0Harmony.dll differ diff --git a/Assemblies/Dismiss_Trader.dll b/Assemblies/Dismiss_Trader.dll index b05f71f..a33c285 100644 Binary files a/Assemblies/Dismiss_Trader.dll and b/Assemblies/Dismiss_Trader.dll differ diff --git a/Source/JobDriver_DismissTrader.cs b/Source/JobDriver_DismissTrader.cs index e16aa94..28e1b36 100644 --- a/Source/JobDriver_DismissTrader.cs +++ b/Source/JobDriver_DismissTrader.cs @@ -27,7 +27,7 @@ public override bool TryMakePreToilReservations() //approach: find Lord transition that is the regular time-out and add another (very short) Trigger_TicksPassed. That'll then fire, and the traders will leave. - //other (failed) approaches: + //other (failed) approaches: //- inheriting from LordJob_TradeWithColony and overriding the stategraph. Set a bool in the job, which works as a trigger. Still seems like the "correct" and OOP approach, but I suck at C# //- adding new LordToil_ExitMapAndEscortCarriers() & telling the lord to jump to it. (lord null, somehow not registered in graph?) //- Outright removing the lord. Works, but also removes the traderflag, defending at exit and the group behaviour. Bad. @@ -41,14 +41,15 @@ protected override IEnumerable MakeNewToils() { Pawn actor = trade.actor; if (this.Trader.CanTradeNow) - { + { Lord lord = Trader.GetLord(); List transitions = lord.Graph.transitions.ToList(); for (int i = 0; i < transitions.Count; i++) { foreach(Trigger trigger in transitions[i].triggers) { - if (trigger.GetType() == typeof(Trigger_TicksPassed)) + //if (trigger.GetType() == typeof(Trigger_TicksPassed)) + if (trigger is Trigger_TicksPassed) // less ugly, more nicer. { transitions[i].triggers.Add(new Trigger_TicksPassed(20)); break;