From 79cd6e19ca76d95e10629050836587014aaa5c8e Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Sun, 24 Sep 2023 10:12:53 +0100 Subject: [PATCH 1/3] init commit --- .../CombatExtended/Jobs/JobDriver_ReloadTurret.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs b/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs index 67f86a1d9b..17a2ff3342 100644 --- a/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs +++ b/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs @@ -74,7 +74,7 @@ public override bool TryMakePreToilReservations(bool errorOnFailed) public override string GetReport() { string text = CE_JobDefOf.ReloadTurret.reportString; - string turretType = (turret.def.hasInteractionCell ? "CE_MannedTurret" : "CE_AutoTurret").Translate(); + string turretType = (turret.TryGetComp() != null ? "CE_MannedTurret" : "CE_AutoTurret").Translate(); text = text.Replace("TurretType", turretType); text = text.Replace("TargetA", TargetThingA.def.label); if (compReloader.UseAmmo) @@ -165,7 +165,14 @@ public override IEnumerable MakeNewToils() } // If ammo system is turned off we just need to go to the turret. - yield return Toils_Goto.GotoCell(turret.Position, PathEndMode.Touch); + if (turret.InteractionCell != null) + { + yield return Toils_Goto.GotoCell(turret.InteractionCell, PathEndMode.Touch); + } + else + { + yield return Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch); + } //If pawn fails reloading from this point, reset isReloading this.AddFinishAction(delegate From 9eb1c2d4174b4d91370ed4c5d0fd96c653205ee6 Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Sun, 24 Sep 2023 10:18:28 +0100 Subject: [PATCH 2/3] stand onto interact cell --- .../CombatExtended/Jobs/JobDriver_ReloadTurret.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs b/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs index 17a2ff3342..166e7ab55d 100644 --- a/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs +++ b/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs @@ -167,7 +167,7 @@ public override IEnumerable MakeNewToils() // If ammo system is turned off we just need to go to the turret. if (turret.InteractionCell != null) { - yield return Toils_Goto.GotoCell(turret.InteractionCell, PathEndMode.Touch); + yield return Toils_Goto.GotoCell(turret.InteractionCell, PathEndMode.OnCell); } else { From fe9f34929b1158d317c19b130df1597b524c3339 Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Thu, 12 Oct 2023 04:40:59 +0100 Subject: [PATCH 3/3] Update JobDriver_ReloadTurret.cs --- .../CombatExtended/Jobs/JobDriver_ReloadTurret.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs b/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs index 166e7ab55d..4b153eeec6 100644 --- a/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs +++ b/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs @@ -77,14 +77,9 @@ public override string GetReport() string turretType = (turret.TryGetComp() != null ? "CE_MannedTurret" : "CE_AutoTurret").Translate(); text = text.Replace("TurretType", turretType); text = text.Replace("TargetA", TargetThingA.def.label); - if (compReloader.UseAmmo) - { - text = text.Replace("TargetB", TargetThingB.def.label); - } - else - { - text = text.Replace("TargetB", "CE_ReloadingGenericAmmo".Translate()); - } + text = compReloader.UseAmmo + ? text.Replace("TargetB", TargetThingB.def.label) + : text.Replace("TargetB", "CE_ReloadingGenericAmmo".Translate()); return text; }