On Demand Fuel Cells (ODFC) by Orum

On Demand Fuel Cells (ODFC) by Orum

3.1k Downloads

[Bug 🐞]: Incorrect syntax in patch results in double patch

linuxgurugamer opened this issue Β· 4 comments

commented

Brief description of your issue (aka the problem)

The patches you have for this mod are broken, they are being run two times, resulting in some double entries. This can be seen in the following image, where the title has the ODFC in the title in indigo two times:

https://i.imgur.com/bLl6SWn.png

and when I looked at the ModuleManager logs, I see the following:

`[LOG 19:32:42.484] Applying update OnDemandFuelCells/Config/LargeCrewedLab/@part[Large?Crewed?Lab]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Science/LargeCrewedLab/largeCrewedLab.cfg/PART[Large_Crewed_Lab]

[LOG 19:32:42.486] Applying update OnDemandFuelCells/Config/StockFuelCells/@part[FuelCell,FuelCellArray]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Resources/FuelCell/FuelCell.cfg/PART[FuelCell]

[LOG 19:32:42.487] Applying update OnDemandFuelCells/Config/StockFuelCells/@part[FuelCell,FuelCellArray]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Resources/FuelCell/FuelCellArray.cfg/PART[FuelCellArray]

[LOG 19:32:42.491] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Command/cupola/cupola.cfg/PART[cupola]

[LOG 19:32:42.491] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Command/hitchhikerStorageContainer/hitchikerStorageContainer.cfg/PART[crewCabin]

[LOG 19:32:42.491] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Command/Mk1-3Pod/mk1-3.cfg/PART[mk1-3pod]

[LOG 19:32:42.492] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Command/mk1LanderCan/mk1LanderCan.cfg/PART[landerCabinSmall]

[LOG 19:32:42.492] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Command/mk1pod_v2/mk1Pod_v2.cfg/PART[mk1pod_v2]

[LOG 19:32:42.492] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Command/mk2LanderCan/mk2LanderCan.cfg/PART[mk2LanderCabin]

[LOG 19:32:42.492] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Command/mk3CockpitShuttle/mk3CockpitShuttle.cfg/PART[mk3Cockpit_Shuttle]

[LOG 19:32:42.496] :AFTER[ONDEMANDFUELCELLS] pass

[LOG 19:32:42.497] Applying update OnDemandFuelCells/Compatibility/ReStockPlus/@part[restock-apu-radial-1]:NEEDS[OnDemandFuelCells,RestockPlus]:AFTER[OnDemandFuelCells] to ReStockPlus/Parts/Electrical/radial/restock-apu-radial-1.cfg/PART[restock-apu-radial-1]

[LOG 19:32:42.500] Applying update OnDemandFuelCells/Compatibility/ReStockPlus/@part[restock-apu-radial-1]:NEEDS[OnDemandFuelCells,RestockPlus]:AFTER[OnDemandFuelCells] to ReStockPlus/Parts/Electrical/radial/restock-apu-radial-1.cfg/PART[restock-apu-radial-1]

[LOG 19:32:42.510] Applying update OnDemandFuelCells/Compatibility/UniversalStorage2/@part[USFuelCellSmal]:NEEDS[UniversalStorage2,OnDemandFuelCells]:AFTER[OnDemandFuelCells] to UniversalStorage2/Parts/Electrical/FuelCellSmall.cfg/PART[USFuelCellSmal]

[LOG 19:32:42.514] Applying update OnDemandFuelCells/Compatibility/UniversalStorage2/@part[USFuelCellMedium]:NEEDS[UniversalStorage2,OnDemandFuelCells]:AFTER[OnDemandFuelCells] to UniversalStorage2/Parts/Electrical/FuelCellMedium.cfg/PART[USFuelCellMedium]

[LOG 19:32:42.516] Applying update OnDemandFuelCells/Config/LargeCrewedLab/@part[Large_Crewed_Lab]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Science/LargeCrewedLab/largeCrewedLab.cfg/PART[Large_Crewed_Lab]

[LOG 19:32:42.522] Applying update OnDemandFuelCells/Config/StockFuelCells/@part[FuelCell]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Resources/FuelCell/FuelCell.cfg/PART[FuelCell]

[LOG 19:32:42.525] Applying update OnDemandFuelCells/Config/StockFuelCells/@part[FuelCellArray]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Resources/FuelCell/FuelCellArray.cfg/PART[FuelCellArray]

[LOG 19:32:42.537] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Command/cupola/cupola.cfg/PART[cupola]

[LOG 19:32:42.538] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Command/hitchhikerStorageContainer/hitchikerStorageContainer.cfg/PART[crewCabin]

[LOG 19:32:42.539] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Command/Mk1-3Pod/mk1-3.cfg/PART[mk1-3pod]

[LOG 19:32:42.540] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Command/mk1LanderCan/mk1LanderCan.cfg/PART[landerCabinSmall]

[LOG 19:32:42.541] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Command/mk1pod_v2/mk1Pod_v2.cfg/PART[mk1pod_v2]

[LOG 19:32:42.541] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Command/mk2LanderCan/mk2LanderCan.cfg/PART[mk2LanderCabin]

[LOG 19:32:42.542] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Command/mk3CockpitShuttle/mk3CockpitShuttle.cfg/PART[mk3Cockpit_Shuttle]

`

The fix is to remove this:

:FOR[OnDemandFuelCells]

which is not needed and, as you can see, results in the patch being applied two times

Operating system

Win 10

KSP version

1.12.5

Version of addon

1.2.99.0pre

Steps to reproduce the behavior or issue

Install mod
Run game
View part in editor

Expected behavior

The patch should only run one time, not two times

Actual behavior

No response

Environment

ODFC: 1.2.99.0pre
Downloaded from SpaceDock (specifying the latest version)

Log files

[LOG 19:32:42.484] Applying update OnDemandFuelCells/Config/LargeCrewedLab/@part[Large?Crewed?Lab]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Science/LargeCrewedLab/largeCrewedLab.cfg/PART[Large_Crewed_Lab]

[LOG 19:32:42.486] Applying update OnDemandFuelCells/Config/StockFuelCells/@part[FuelCell,FuelCellArray]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Resources/FuelCell/FuelCell.cfg/PART[FuelCell]

[LOG 19:32:42.487] Applying update OnDemandFuelCells/Config/StockFuelCells/@part[FuelCell,FuelCellArray]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Resources/FuelCell/FuelCellArray.cfg/PART[FuelCellArray]

[LOG 19:32:42.491] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Command/cupola/cupola.cfg/PART[cupola]

[LOG 19:32:42.491] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Command/hitchhikerStorageContainer/hitchikerStorageContainer.cfg/PART[crewCabin]

[LOG 19:32:42.491] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Command/Mk1-3Pod/mk1-3.cfg/PART[mk1-3pod]

[LOG 19:32:42.492] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Command/mk1LanderCan/mk1LanderCan.cfg/PART[landerCabinSmall]

[LOG 19:32:42.492] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Command/mk1pod_v2/mk1Pod_v2.cfg/PART[mk1pod_v2]

[LOG 19:32:42.492] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Command/mk2LanderCan/mk2LanderCan.cfg/PART[mk2LanderCabin]

[LOG 19:32:42.492] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Command/mk3CockpitShuttle/mk3CockpitShuttle.cfg/PART[mk3Cockpit_Shuttle]

[LOG 19:32:42.496] :AFTER[ONDEMANDFUELCELLS] pass

[LOG 19:32:42.497] Applying update OnDemandFuelCells/Compatibility/ReStockPlus/@part[restock-apu-radial-1]:NEEDS[OnDemandFuelCells,RestockPlus]:AFTER[OnDemandFuelCells] to ReStockPlus/Parts/Electrical/radial/restock-apu-radial-1.cfg/PART[restock-apu-radial-1]

[LOG 19:32:42.500] Applying update OnDemandFuelCells/Compatibility/ReStockPlus/@part[restock-apu-radial-1]:NEEDS[OnDemandFuelCells,RestockPlus]:AFTER[OnDemandFuelCells] to ReStockPlus/Parts/Electrical/radial/restock-apu-radial-1.cfg/PART[restock-apu-radial-1]

[LOG 19:32:42.510] Applying update OnDemandFuelCells/Compatibility/UniversalStorage2/@part[USFuelCellSmal]:NEEDS[UniversalStorage2,OnDemandFuelCells]:AFTER[OnDemandFuelCells] to UniversalStorage2/Parts/Electrical/FuelCellSmall.cfg/PART[USFuelCellSmal]

[LOG 19:32:42.514] Applying update OnDemandFuelCells/Compatibility/UniversalStorage2/@part[USFuelCellMedium]:NEEDS[UniversalStorage2,OnDemandFuelCells]:AFTER[OnDemandFuelCells] to UniversalStorage2/Parts/Electrical/FuelCellMedium.cfg/PART[USFuelCellMedium]

[LOG 19:32:42.516] Applying update OnDemandFuelCells/Config/LargeCrewedLab/@part[Large_Crewed_Lab]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Science/LargeCrewedLab/largeCrewedLab.cfg/PART[Large_Crewed_Lab]

[LOG 19:32:42.522] Applying update OnDemandFuelCells/Config/StockFuelCells/@part[FuelCell]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Resources/FuelCell/FuelCell.cfg/PART[FuelCell]

[LOG 19:32:42.525] Applying update OnDemandFuelCells/Config/StockFuelCells/@part[FuelCellArray]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Resources/FuelCell/FuelCellArray.cfg/PART[FuelCellArray]

[LOG 19:32:42.537] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Command/cupola/cupola.cfg/PART[cupola]

[LOG 19:32:42.538] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Command/hitchhikerStorageContainer/hitchikerStorageContainer.cfg/PART[crewCabin]

[LOG 19:32:42.539] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Command/Mk1-3Pod/mk1-3.cfg/PART[mk1-3pod]

[LOG 19:32:42.540] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Command/mk1LanderCan/mk1LanderCan.cfg/PART[landerCabinSmall]

[LOG 19:32:42.541] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Command/mk1pod_v2/mk1Pod_v2.cfg/PART[mk1pod_v2]

[LOG 19:32:42.541] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Command/mk2LanderCan/mk2LanderCan.cfg/PART[mk2LanderCabin]

[LOG 19:32:42.542] Applying update OnDemandFuelCells/Config/StockPods/@part[crewCabin,mk1-3pod,landerCabinSmall,mk1pod,mk1pod_v2,mk2LanderCabin,mk2LanderCabin_V2,mk3Cockpit_Shuttle,cupola,mk2Pod]:NEEDS[OnDemandFuelCells]:AFTER[OnDemandFuelCells] to Squad/Parts/Command/mk3CockpitShuttle/mk3CockpitShuttle.cfg/PART[mk3Cockpit_Shuttle]

Screenshots

Image

Additional context

No response

How did you download and install this?

SpaceDock (manual install)

commented

It was a quick look, and yes, I got it wrong. Thanks for fixing so quickly, it was causing issues in a new mod.
FYI, could you mark it as a full release, so that CKAN can properly use the latest version? I didn't see the issue until I realized that it was a prerelease.

commented

πŸ‘ Thank you @linuxgurugamer :octocat:

❓❔

Have you reviewed the open issues logs and recent changelogs?

In order to help us help you, please provide:

  • <KSP_ROOT>/KSP.LOG
  • and one of the following:
    • if Module Manger is installed
      • <KSP_ROOT>/GameData/ModuleManager.ConfigCache
    • if Module Manger /L is installed
      • <KSP_ROOT>/PluginData\ModuleManager\ConfigCache.cfg
  • Screenshots of issue (if appropriate) (images tell a much stronger tale)

You can archive these files (rar or zip, sadly no 7zip) and drag-n-drop them into an issue comment

πŸ“³πŸ‘€Please either watch this repositiory for updates.

πŸ’¬Kindly read our simple guides to:

commented

@linuxgurugamer , sorry but your diagnose is incorrect. The :FOR[foo]:NEEDS[foo] is harmless when used on a patch inside a directory with the same name and, so, by removing one or even both, the problem will stay the same. And even when it's harmful (not the case here, just to clarify), it would not induce double patching - unless some mishap inside KSP fires up ModuleManager twice (what's apparently is not happening anymore, not sure why), inducing MM to run :FOR[foo] twice.

The problem is way more simple: there are two different patches applying the same data into the Large_Crewed_Lab part:

[LOG 22:56:21.033] [ModuleManager] INFO: Applying update OnDemandFuelCells/Config/LargeCrewedLab/@PART[Large?Crewed?Lab]:NEEDS[OnDemandFuelCells]:FOR[OnDemandFuelCells] to Squad/Parts/Science/LargeCrewedLab/largeCrewedLab.cfg/PART[Large_Crewed_Lab]
<...>
[LOG 22:56:21.237] [ModuleManager] INFO: Applying update OnDemandFuelCells/Config/OnDemandFuelCells/@PART[*]:HAS[@MODULE[ODFC]]:NEEDS[OnDemandFuelCells]:LAST[OnDemandFuelCells] to Squad/Parts/Science/LargeCrewedLab/largeCrewedLab.cfg/PART[Large_Crewed_Lab]

Being more specific, the problem is the following two lines:

The problem is also happening on HEAD and in the latest release, by the way (just checked).

ping @zer0Kerbal

--- EDIT

I had misidentified the second patch, the information above is correct now.

In a way or another, I'm applying a pull request with the minimal set of changes to fix the issue at hands.

commented

A pull request fixing the (real) issue was applied.

#104